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));
        }
 public void SaveProfile(IEnumerable <LanguageModel <string> > languageModels, Stream outputStream)
 {
     XmlProfilePersister.Save(languageModels, MaximumSizeOfDistribution, MaxNGramLength, outputStream);
 }