public static LanguageDetector GetLanguageDetectorPrebuilt()
 {
     LanguageDetector ld = new LanguageDetector();
     Assembly assembly = Assembly.GetExecutingAssembly();
     foreach (string resName in assembly.GetManifestResourceNames())
     {
         if (resName.EndsWith(".ldp"))
         {
             // load language detector profile
             BinarySerializer ser = new BinarySerializer(assembly.GetManifestResourceStream(resName));
             LanguageProfile langProfile = new LanguageProfile(ser);
             ser.Close();
             ld.AddLanguageProfile(langProfile);
             mLogger.Debug("GetLanguageDetectorPrebuilt", "Loaded resource {0}.", resName);
         }
     }
     return ld;
 }
Exemple #2
0
        public static LanguageDetector GetLanguageDetectorPrebuilt()
        {
            LanguageDetector ld       = new LanguageDetector();
            Assembly         assembly = Assembly.GetExecutingAssembly();

            foreach (string resName in assembly.GetManifestResourceNames())
            {
                if (resName.EndsWith(".ldp"))
                {
                    // load language detector profile
                    BinarySerializer ser         = new BinarySerializer(assembly.GetManifestResourceStream(resName));
                    LanguageProfile  langProfile = new LanguageProfile(ser);
                    ser.Close();
                    ld.AddLanguageProfile(langProfile);
                    mLogger.Debug("GetLanguageDetectorPrebuilt", "Loaded resource {0}.", resName);
                }
            }
            return(ld);
        }