Class: Punkt::Parameters

Inherits:
Object
  • Object
show all
Defined in:
lib/punkt-segmenter/punkt/parameters.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParameters

Returns a new instance of Parameters.



9
10
11
12
13
14
# File 'lib/punkt-segmenter/punkt/parameters.rb', line 9

def initialize
  clear_abbreviations
  clear_collocations
  clear_sentence_starters
  clear_orthographic_context
end

Instance Attribute Details

#abbreviation_typesObject

Returns the value of attribute abbreviation_types.



4
5
6
# File 'lib/punkt-segmenter/punkt/parameters.rb', line 4

def abbreviation_types
  @abbreviation_types
end

#collocationsObject

Returns the value of attribute collocations.



5
6
7
# File 'lib/punkt-segmenter/punkt/parameters.rb', line 5

def collocations
  @collocations
end

#orthographic_contextObject

Returns the value of attribute orthographic_context.



7
8
9
# File 'lib/punkt-segmenter/punkt/parameters.rb', line 7

def orthographic_context
  @orthographic_context
end

#sentence_startersObject

Returns the value of attribute sentence_starters.



6
7
8
# File 'lib/punkt-segmenter/punkt/parameters.rb', line 6

def sentence_starters
  @sentence_starters
end

Instance Method Details

#add_orthographic_context(type, flag) ⇒ Object



32
33
34
# File 'lib/punkt-segmenter/punkt/parameters.rb', line 32

def add_orthographic_context(type, flag)
  @orthographic_context[type] |= flag
end

#clear_abbreviationsObject



16
17
18
# File 'lib/punkt-segmenter/punkt/parameters.rb', line 16

def clear_abbreviations
  @abbreviation_types   = Set.new
end

#clear_collocationsObject



20
21
22
# File 'lib/punkt-segmenter/punkt/parameters.rb', line 20

def clear_collocations
  @collocations         = Set.new
end

#clear_orthographic_contextObject



28
29
30
# File 'lib/punkt-segmenter/punkt/parameters.rb', line 28

def clear_orthographic_context
  @orthographic_context = Hash.new(0)
end

#clear_sentence_startersObject



24
25
26
# File 'lib/punkt-segmenter/punkt/parameters.rb', line 24

def clear_sentence_starters
  @sentence_starters    = Set.new
end