public override void Run(string input, IGlossary glossary) { this.glossary = glossary; glossary.ProcessSynsets(wordnet); IEnumerable<string> sentences = nlp.DetectSentences(input); foreach (string sentence in sentences) { IEnumerable<string> words = nlp.Tokenize(sentence); IEnumerable<string> tags = nlp.PosTag(words); foreach (Term term in words.Zip(tags, (word, tag) => new Term { PoS = new POS(tag), Word = word })) { // bag of words bow.AddWord(term.Word.ToLower()); // main stuff term.Synset = SelectSynset(term.Word, term.PoS); terms.Add(term); flatRepo.Add(term); } } LogFacade.LogBOW(bow); }
public override void Run(string input, IGlossary glossary) { this.glossary = glossary; glossary.ProcessSynsets(wordnet); IEnumerable <string> sentences = nlp.DetectSentences(input); foreach (string sentence in sentences) { IEnumerable <string> words = nlp.Tokenize(sentence); IEnumerable <string> tags = nlp.PosTag(words); foreach (Term term in words.Zip(tags, (word, tag) => new Term { PoS = new POS(tag), Word = word })) { // bag of words bow.AddWord(term.Word.ToLower()); // main stuff term.Synset = SelectSynset(term.Word, term.PoS); terms.Add(term); flatRepo.Add(term); } } LogFacade.LogBOW(bow); }
public void Run(IInputReader inputReader, IInputReader glossaryReader) { glossary = new DefaultGlossary(glossaryReader, Properties.Settings.Default.ReadGlossaryIds); input = inputReader.ReadInput(); foreach (IExecution execution in executions) { execution.Run(input, glossary); } }
public abstract void Run(string input, IGlossary glossary);