Package org.apache.nutch.analysis.lang.custom

Examples of org.apache.nutch.analysis.lang.custom.LanguageIdentifier.identify()


   * @return detected language
   */
  public static String detectLanguage(String text) {
    LanguageIdentifier li = getLIInstance();

    return li.identify(text);
  }

  /**
   * Detect language from an input stream
   * @param is
View Full Code Here


   * @return detected language
   * @throws IOException
   */
  public static String detectLanguage(InputStream is) throws IOException {
    LanguageIdentifier li = getLIInstance();
    return li.identify(is);
  }

  /**
   * Detect language from an input stream
   * @param is
View Full Code Here

   * @return detected language
   * @throws IOException
   */
  public static String detectLanguage(InputStream is, String charset) throws IOException {
    LanguageIdentifier li = getLIInstance();
    return li.identify(is, charset);
  }

  private static LanguageIdentifier getLIInstance() {
    if (langID == null) {
      langID = new LanguageIdentifier();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.