Exemple #1
0
        public ArrayList <KeyDat <double, LanguageProfile> > DetectLanguageAll(string str)
        {
            Utils.ThrowException(mLanguageProfiles.Count == 0 ? new InvalidOperationException() : null);
            Utils.ThrowException(str == null ? new ArgumentNullException("str") : null);
            NGramProfile p = new NGramProfile(mN);

            p.AddTokensFromString(str);
            if (p.IsEmpty)
            {
                return(null);
            }
            p.DoRanking();
            return(DetectLanguageAll(p));
        }
Exemple #2
0
        public LanguageProfile FindMatchingLanguage(string str)
        {
            Utils.ThrowException(languageProfiles.Count == 0 ? new InvalidOperationException() : null);
            Utils.ThrowException(str == null ? new ArgumentNullException("str") : null);
            NGramProfile p = new NGramProfile(n);

            p.AddTokensFromString(str);
            if (p.IsEmpty)
            {
                return(null);
            }
            p.DoRanking();
            return(FindMatchingLanguage(p));
        }
 public ArrayList<KeyDat<double, LanguageProfile>> DetectLanguageAll(string str)
 {
     Utils.ThrowException(mLanguageProfiles.Count == 0 ? new InvalidOperationException() : null);
     Utils.ThrowException(str == null ? new ArgumentNullException("str") : null);
     NGramProfile p = new NGramProfile(mN);
     p.AddTokensFromString(str);
     if (p.IsEmpty) { return null; }
     p.DoRanking();
     return DetectLanguageAll(p);
 }