def find_language(text)
      text_utf8 = text.encode(Encoding::UTF_8)
      pointer = FFI::MemoryPointer.new(:char, text_utf8.bytesize)
      pointer.put_bytes(0, text_utf8)

      cc_result = Unstable.NNetLanguageIdentifier_find_language(@cc, pointer, text_utf8.bytesize)
      language = cc_result[:language_data].read_bytes(cc_result[:language_size])

      Result.new(
          language == "und" ? nil : language.to_sym,
          cc_result[:probability],
          cc_result[:reliable?],
          cc_result[:proportion])
    end
def find_language(text)
      text_utf8 = text.encode(Encoding::UTF_8)
      pointer = FFI::MemoryPointer.new(:char, text_utf8.bytesize)
      pointer.put_bytes(0, text_utf8)

      cc_result = Unstable.NNetLanguageIdentifier_find_language(@cc, pointer, text_utf8.bytesize)
      language = cc_result[:language_data].read_bytes(cc_result[:language_size])

      Result.new(
          language == "und" ? nil : language.to_sym,
          cc_result[:probability],
          cc_result[:reliable?],
          cc_result[:proportion])
    end
The arguments are two String objects.
 Finds the most likely language for the given text, along with additional
 information (e.g., probability). The prediction is based on the first N
 bytes where N is the minumum between the number of interchange valid UTF8
 bytes and +max_num_bytes_+. If N is less than +min_num_bytes_+ long, then
 this function returns nil as language.
 The argument is a String object.
 The returned value of this function is an instance of Result.