private void initComponents() { sentenceDetector = new EnglishMaximumEntropySentenceDetector(Path.Combine(ModelDir, "EnglishSD.nbin")); tokenizer = new EnglishMaximumEntropyTokenizer(Path.Combine(ModelDir, "EnglishTok.nbin")); posTagger = new EnglishMaximumEntropyPosTagger(Path.Combine(ModelDir, "EnglishPOS.nbin")); chunker = new EnglishTreebankChunker(Path.Combine(ModelDir, "EnglishChunk.nbin")); parser = new EnglishTreebankParser(FileUtils.WithSeparator(ModelDir), true, false); }
public ParseBasedPhrasalVerbDetector(EnglishTreebankParser parser, Lemmatizer lemmatizer, EnglishMaximumEntropyTokenizer tokenizer, EnglishMaximumEntropyPosTagger tagger) { this.parser = parser; this.lemmatizer = lemmatizer; this.tokenizer = tokenizer; this.tagger = tagger; }
private Parse ParseSentence(string sentence) { if (_parser == null) { _parser = new EnglishTreebankParser(_modelPath, true, false); } return(_parser.DoParse(sentence)); }
public static OpenNLP.Tools.Parser.Parse ParseSentence(string sentence) { if (mParser == null) { mParser = new OpenNLP.Tools.Parser.EnglishTreebankParser(mModelPath, true, false); } return(mParser.DoParse(sentence)); }
private static EnglishTreebankParser GetParser() { if (_parser == null) { var modelPath = PathToApplication + "Resources/OpenNlp/Models/"; _parser = new EnglishTreebankParser(modelPath, true, false); } return(_parser); }
private string MySentenceStructure(string sentence) { var modelPath = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) + @"\Models\"; var parser = new EnglishTreebankParser(modelPath); var parse = parser.DoParse(sentence); var result = parse.Show(); return(result); }
private void ShowParse() { if (txtInput.Text.Length == 0) { return; } //prepare the UI txtInput.Enabled = false; btnParse.Enabled = false; this.Cursor = Cursors.WaitCursor; lithiumControl.NewDiagram(); //do the parsing if (mParser == null) { mParser = new EnglishTreebankParser(mModelPath, true, false); } mParse = mParser.DoParse(txtInput.Text); if (mParse.Type == MaximumEntropyParser.TopNode) { mParse = mParse.GetChildren()[0]; } //display the parse result ShapeBase root = this.lithiumControl.Root; root.Text = mParse.Type; root.Visible = true; AddChildNodes(root, mParse.GetChildren()); root.Expand(); this.lithiumControl.DrawTree(); //restore the UI this.Cursor = Cursors.Default; txtInput.Enabled = true; btnParse.Enabled = true; }
public OpenNLPBridge() { _parser = new EnglishTreebankParser(ConfigurationManager.AppSettings["ModelsLocation"]); }
public PosTagger() { nlpParser = new EnglishTreebankParser(nbinFilePath, true, false); }