language-identifier/lib/opener/language_identifier/detector.rb
def build_priorities(input, languages)
        priorities = java.util.HashMap.new
        priority   = short_input?(input) ? 0.0 : DEFAULT_PRIORITY

        PRIORITIES.each do |lang, val|
          priorities.put(lang, val)
        end

        languages.each do |language|
          unless priorities.contains_key(language)
            priorities.put(language, priority)
          end
        end

        return priorities
      end
##
# Builds a Java Hash mapping the priorities for all OpeNER and non OpeNER
# languages.
#
# If the input size is smaller than the short profiles threshold non
# OpeNER languages are _disabled_. This is to ensure that these languages
# are detected properly when analysing only 1-2 words.
#
# @param [String] input
# @param [Array<String>] languages
# @return [java.util.HashMap]
#
Builds a Java Hash mapping the priorities for all OpeNER and non OpeNER
languages.

If the input size is smaller than the short profiles threshold non
OpeNER languages are _disabled_. This is to ensure that these languages
are detected properly when analysing only 1-2 words.
Builds a Java Hash mapping the priorities for all OpeNER and non OpeNER languages . If the input size is smaller than the short profiles threshold non OpeNER languages are _disabled_ . This is to ensure that these languages are detected properly when analysing only 1 - 2 words .
def build_priorities(input, languages)
        priorities = java.util.HashMap.new
        priority   = short_input?(input) ? 0.0 : DEFAULT_PRIORITY
        PRIORITIES.each do |lang, val|
          priorities.put(lang, val)
        end
        languages.each do |language|
          unless priorities.contains_key(language)
            priorities.put(language, priority)
          end
        end
        return priorities
      end
def build_priorities ( input , languages ) priorities = java . util . HashMap . new priority = short_input? ( input ) ? 0.0 : DEFAULT_PRIORITY PRIORITIES . each do | lang , val | priorities . put ( lang , val ) end languages . each do | language | unless priorities . contains_key ( language ) priorities . put ( language , priority ) end end return priorities end
Builds a Java Hash mapping the priorities for all OpeNER and non OpeNER
languages.
Builds a Java Hash mapping the priorities for all OpeNER and non OpeNER languages .
None
java.util.HashMap
input
languages
None