lib/langusta/lang_profile.rb
# Adds a given NGram to this language profile. This operation is expected to be invoked multiple times for the same arguments.
# @param gram [Array<Fixnum>]
Adds a given NGram to this language profile. This operation is expected to be invoked multiple times for the same arguments.
Adds a given NGram to this language profile . This operation is expected to be invoked multiple times for the same arguments .
def add(gram)
      return if gram.nil?
      Guard.klass(gram, Array, __method__)
      length = gram.size
      return if length < 1 or length > NGram::N_GRAM
      @n_words[length - 1] += 1
      @freq[gram] ||= 0
      @freq[gram] += 1
    end
def add ( gram ) return if gram . nil? Guard . klass ( gram , Array , __method__ ) length = gram . size return if length < 1 or length > NGram :: N_GRAM @n_words [ length - 1 ] += 1 @freq [ gram ] ||= 0 @freq [ gram ] += 1 end
Adds a given NGram to this language profile.
Adds a given NGram to this language profile .
gram
<not_specific>
<not_specific>
None