Exemplo n.º 1
0
        /// <summary>
        /// Stems document, creating new document, which is stemmed
        /// </summary>
        /// <param name="document">document to stem</param>
        /// <param name="stemmerInterface">stemmer interface to use</param>
        /// <returns>document, with all words stemmed.</returns>
        public static Document StemDocument(Document document, IStemmerInterface stemmerInterface)
        {
            if (document == null) throw new ArgumentNullException("document");

            var words = new List<string>();
            foreach (string word in document.Words)
            {
                words.Add(stemmerInterface.StemTerm(word));
            }

            return new Document(words);
        }
Exemplo n.º 2
0
 public DocumentsProvider(IStemmerInterface stemmer)
     : this(stemmer, new NullDocumentPurer())
 {
 }
Exemplo n.º 3
0
 public DocumentsProvider(IStemmerInterface stemmer, IDocumentPurer documentPurer)
 {
     _documentPurer = documentPurer;
     _stemmer = stemmer;
 }
Exemplo n.º 4
0
 public TermsProvider(IStemmerInterface stemmerInterface)
 {
     _stemmerInterface = stemmerInterface;
 }