Module: Raingrams

Defined in:
lib/raingrams/model.rb,
lib/raingrams/ngram.rb,
lib/raingrams/version.rb,
lib/raingrams/ngram_set.rb,
lib/raingrams/raingrams.rb,
lib/raingrams/bigram_model.rb,
lib/raingrams/tokens/token.rb,
lib/raingrams/tokens/tokens.rb,
lib/raingrams/trigram_model.rb,
lib/raingrams/helpers/random.rb,
lib/raingrams/hexagram_model.rb,
lib/raingrams/quadgram_model.rb,
lib/raingrams/tokens/unknown.rb,
lib/raingrams/pentagram_model.rb,
lib/raingrams/helpers/frequency.rb,
lib/raingrams/probability_table.rb,
lib/raingrams/helpers/similarity.rb,
lib/raingrams/helpers/commonality.rb,
lib/raingrams/helpers/probability.rb,
lib/raingrams/tokens/stop_sentence.rb,
lib/raingrams/open_vocabulary/model.rb,
lib/raingrams/tokens/start_sentence.rb,
lib/raingrams/open_vocabulary/open_model.rb,
lib/raingrams/open_vocabulary/bigram_model.rb,
lib/raingrams/open_vocabulary/trigram_model.rb,
lib/raingrams/open_vocabulary/hexagram_model.rb,
lib/raingrams/open_vocabulary/quadgram_model.rb,
lib/raingrams/open_vocabulary/pentagram_model.rb,
lib/raingrams/exceptions/prefix_frequency_missing.rb

Defined Under Namespace

Modules: Helpers, OpenVocabulary, Tokens Classes: BigramModel, HexagramModel, Model, Ngram, NgramSet, PentagramModel, PrefixFrequencyMissing, ProbabilityTable, QuadgramModel, TrigramModel

Constant Summary collapse

VERSION =
'0.1.2'

Class Method Summary collapse

Class Method Details

.closed_vocabulary_model(options = {}, &block) ⇒ Object



5
6
7
# File 'lib/raingrams/raingrams.rb', line 5

def Raingrams.closed_vocabulary_model(options={},&block)
  Model.new(options,&block)
end

.model(options = {}, &block) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/raingrams/raingrams.rb', line 13

def Raingrams.model(options={},&block)
  case options[:vocabulary]
  when :open, 'open'
    return Raingrams.open_vocabulary_model(options,&block)
  else
    return Raingrams.closed_vocabulary_model(options,&block)
  end
end

.open_vocabulary_model(options = {}, &block) ⇒ Object



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

def Raingrams.open_vocabulary_model(options={},&block)
  OpenVocabulary::Model.new(options,&block)
end