Beispiel #1
0
        public T Load(Stream inputStream, Func <LanguageModel <string>, bool> filterPredicate = null)
        {
            filterPredicate = filterPredicate ?? (_ => true);
            int maxNGramLength;
            int maximumSizeOfDistribution;
            var languageModelList =
                XmlProfilePersister.Load <string>(inputStream, out maximumSizeOfDistribution, out maxNGramLength)
                .Where(filterPredicate);

            return(Create(languageModelList, maxNGramLength, maximumSizeOfDistribution, OccuranceNumberThreshold, OnlyReadFirstNLines));
        }
Beispiel #2
0
 public void SaveProfile(IEnumerable <LanguageModel <string> > languageModels, Stream outputStream)
 {
     XmlProfilePersister.Save(languageModels, MaximumSizeOfDistribution, MaxNGramLength, outputStream);
 }