Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit bda2196

Browse files
committed
Rename is_reliable to reliable?
1 parent e4b4f51 commit bda2196

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/cld3.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class NNetLanguageIdentifier
4444
RELIABILITY_HR_BS_THRESHOLD = 0.5
4545

4646
# Information about a predicted language.
47-
Result = Struct.new("Result", :language, :probability, :is_reliable, :proportion)
47+
Result = Struct.new("Result", :language, :probability, :reliable?, :proportion)
4848

4949
def initialize(minNumBytes = MIN_NUM_BYTES_TO_CONSIDER, maxNumBytes = MAX_NUM_BYTES_TO_CONSIDER)
5050
@cc = Pointer.new(CLD3::Unstable.new_NNetLanguageIdentifier(minNumBytes, maxNumBytes))
@@ -66,7 +66,7 @@ def find_language(text)
6666
Result.new(
6767
language == "und" ? nil : language,
6868
cc_result[:probability],
69-
cc_result[:is_reliable],
69+
cc_result[:reliable?],
7070
cc_result[:proportion])
7171
end
7272

@@ -86,7 +86,7 @@ module Unstable
8686
ffi_lib File.join(File.expand_path(File.dirname(__FILE__)), "..", "ext", "cld3", FFI.map_library_name("cld3"))
8787

8888
class NNetLanguageIdentifierResult < FFI::Struct
89-
layout :language_data, :pointer, :language_size, :size_t, :probability, :float, :proportion, :float, :is_reliable, :bool
89+
layout :language_data, :pointer, :language_size, :size_t, :probability, :float, :proportion, :float, :reliable?, :bool
9090
end
9191

9292
attach_function :delete_NNetLanguageIdentifier, [ :pointer ], :void

0 commit comments

Comments
 (0)