Exemplo n.º 1
0
        public FeatureTermNest Build(GlobalIndex index)
        {
            FeatureTermNest featureTermNest = new FeatureTermNest(index);

            if (index.GetCanonicalTerms().Count == 0 || index.GetDocuments().Count == 0)
            {
                throw new ArgumentException("No resource Indexed.");
            }

            Check(index.GetCanonicalTerms(), index.GetCanonicalTerms(), featureTermNest);

            return(featureTermNest);
        }
Exemplo n.º 2
0
 public AlgorithmContext(FeatureCorpusTermFrequency termFrequency, FeatureTermNest termNest)
 {
     this.termFrequency = termFrequency;
     this.termNest      = termNest;
 }
Exemplo n.º 3
0
 private void Check(ICollection <string> nounPhrases, ICollection <string> allNounPhrases, FeatureTermNest featureTermNest)
 {
     foreach (string nounPhrase in nounPhrases)
     {
         foreach (string docNounPhrase in allNounPhrases)
         {
             if (docNounPhrase.Length <= nounPhrase.Length)
             {
                 continue;
             }
             if (docNounPhrase.IndexOf(" " + nounPhrase) != -1 || docNounPhrase.IndexOf(nounPhrase + " ") != -1)
             {
                 featureTermNest.TermNestIn(nounPhrase, docNounPhrase);
             }
         }
     }
 }