lib/moo_ebooks/model.rb
# Reverse lookup a token index from a token
# @param token [String]
# @return [Integer]
Reverse lookup a token index from a token
Reverse lookup a token index from a token
def tikify(token)
      if @tikis.key?(token)
        @tikis[token]
      else
        @tokens << token
        @tikis[token] = @tokens.length - 1
      end
    end
def tikify ( token ) if @tikis . key? ( token ) @tikis [ token ] else @tokens << token @tikis [ token ] = @tokens . length - 1 end end
Reverse lookup a token index from a token
Reverse lookup a token index from a token
None
Integer
token
None