Class LanguageNames

  • public class LanguageNames
    extends java.lang.Object
    Support for language tags (as defined by See for a list of three character language codes. TODO change to LanguageTag, and use these vs. strings everywhere in the language detector API?
    • Constructor Summary

      Constructor Description
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean equals​(java.lang.String languageTagA, java.lang.String languageTagB)  
      static java.lang.String getMacroLanguage​(java.lang.String languageTag)
      If language is a specific variant of a macro language (e.g.
      static boolean hasMacroLanguage​(java.lang.String languageTag)  
      static boolean isMacroLanguage​(java.lang.String languageTag)  
      static java.lang.String makeName​(java.lang.String language, java.lang.String script, java.lang.String region)  
      static java.lang.String normalizeName​(java.lang.String languageTag)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LanguageNames

        public LanguageNames()
    • Method Detail

      • makeName

        public static java.lang.String makeName​(java.lang.String language,
                                                java.lang.String script,
                                                java.lang.String region)
      • normalizeName

        public static java.lang.String normalizeName​(java.lang.String languageTag)
      • isMacroLanguage

        public static boolean isMacroLanguage​(java.lang.String languageTag)
      • hasMacroLanguage

        public static boolean hasMacroLanguage​(java.lang.String languageTag)
      • getMacroLanguage

        public static java.lang.String getMacroLanguage​(java.lang.String languageTag)
        If language is a specific variant of a macro language (e.g. 'nb' for Norwegian Bokmal), return the macro language (e.g. 'no' for Norwegian). If it doesn't have a macro language, return unchanged.
        languageTag -
      • equals

        public static boolean equals​(java.lang.String languageTagA,
                                     java.lang.String languageTagB)