Exemple #1
0
        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);
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
        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);
            }
        }
Exemple #5
0
 public abstract void Run(string input, IGlossary glossary);
 public abstract void Run(string input, IGlossary glossary);