nlp :: NLPProcessor :: process_file
# Creates a new NLPDocument from a file content
fun process_file(path: String): NLPDocument do
var content = path.to_path.read_all
return process(content)
end
lib/nlp/stanford.nit:34,2--38,4
# Process the `input` file and return a new NLPDocument from this.
redef fun process_file(input) do
# TODO opt annotators
var tmp_file = "{input.basename}.xml"
sys.system "java -cp \"{java_cp}\" -Xmx2g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma -outputFormat xml -file {input}"
var doc = new NLPDocument.from_xml_file(tmp_file)
tmp_file.file_delete
return doc
end
lib/nlp/stanford.nit:75,2--83,4