code: public static List<Pair<TregexPattern, TsurgeonPattern>> getOperationsFromFile(String filename, String encoding, TregexPatternCompiler compiler) throws IOException {
      List<Pair<TregexPattern,TsurgeonPattern>> operations = new ArrayList<Pair<TregexPattern, TsurgeonPattern>>();
      BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename), encoding));
      for ( ; ; ) {
        Pair<TregexPattern, TsurgeonPattern> operation = getOperationFromReader(reader, compiler);
        if (operation == null) {
          break;
        }
        operations.add(operation);
      }
      reader.close();
      return operations;
    }
docs: Parses a tsurgeon script file and compiles all operations in the file into a list
  of pairs of tregex and tsurgeon patterns.
  
  @param filename file containing the tsurgeon script
  @return A pair of a tregex and tsurgeon pattern read from a file
  @throws IOException If there is any I/O problem