Module: Raingrams::Tokens

Defined in:
lib/raingrams/tokens/token.rb,
lib/raingrams/tokens/tokens.rb,
lib/raingrams/tokens/unknown.rb,
lib/raingrams/tokens/stop_sentence.rb,
lib/raingrams/tokens/start_sentence.rb

Defined Under Namespace

Classes: StartSentence, StopSentence, Token, Unknown

Class Method Summary collapse

Class Method Details

.allObject

Returns all defined tokens.



10
11
12
# File 'lib/raingrams/tokens/tokens.rb', line 10

def Tokens.all
  @@raingram_tokens ||= {}
end

.startObject

Returns the start sentence token.



17
18
19
# File 'lib/raingrams/tokens/tokens.rb', line 17

def Tokens.start
  Tokens.all[:start] ||= StartSentence.new
end

.stopObject

Returns the stop sentence token.



24
25
26
# File 'lib/raingrams/tokens/tokens.rb', line 24

def Tokens.stop
  Tokens.all[:stop] ||= StopSentence.new
end

.unknownObject

Returns the unknown word token.



31
32
33
# File 'lib/raingrams/tokens/tokens.rb', line 31

def Tokens.unknown
  Tokens.all[:unknown] ||= Unknown.new
end