language-identifier/lib/opener/language_identifier/detector.rb
def new_detector(input)
        factory = com.cybozu.labs.langdetect.DetectorFactory.new

        factory.load_profile(determine_profiles(input))
        factory.set_seed(1)

        priorities = build_priorities(input, factory.langlist)
        detector   = com.cybozu.labs.langdetect.Detector.new(factory)

        detector.set_prior_map(priorities)
        detector.append(input.downcase)

        return detector
      end
##
# Returns a new detector with the profiles set based on the input.
#
# This method analyses a lowercased version of the input as this yields
# better results for short text.
#
# @param [String] input
# @return [CybozuDetector]
#
Returns a new detector with the profiles set based on the input.
This method analyses a lowercased version of the input as this yields
better results for short text.
Returns a new detector with the profiles set based on the input . This method analyses a lowercased version of the input as this yields better results for short text .
def new_detector(input)
        factory = com.cybozu.labs.langdetect.DetectorFactory.new
        factory.load_profile(determine_profiles(input))
        factory.set_seed(1)
        priorities = build_priorities(input, factory.langlist)
        detector   = com.cybozu.labs.langdetect.Detector.new(factory)
        detector.set_prior_map(priorities)
        detector.append(input.downcase)
        return detector
      end
def new_detector ( input ) factory = com . cybozu . labs . langdetect . DetectorFactory . new factory . load_profile ( determine_profiles ( input ) ) factory . set_seed ( 1 ) priorities = build_priorities ( input , factory . langlist ) detector = com . cybozu . labs . langdetect . Detector . new ( factory ) detector . set_prior_map ( priorities ) detector . append ( input . downcase ) return detector end
Returns a new detector with the profiles set based on the input.
Returns a new detector with the profiles set based on the input .
None
CybozuDetector
input
None