Class: SFST::CompactTransducer
- Inherits:
-
CompactTransducerMachine
- Object
- CompactTransducerMachine
- SFST::CompactTransducer
- Defined in:
- lib/sfst.rb
Overview
A compact transducer.
Instance Method Summary collapse
-
#accepted_analysis?(string) ⇒ Boolean
Checks if the string
string
is accepted for analysis. -
#analyze(form) ⇒ Object
(also: #analyse)
Analyses a string
string
. -
#initialize(file) ⇒ CompactTransducer
constructor
A new instance of CompactTransducer.
Constructor Details
#initialize(file) ⇒ CompactTransducer
Returns a new instance of CompactTransducer.
80 81 82 |
# File 'lib/sfst.rb', line 80 def initialize(file) @fst = CompactTransducerMachine.new(file) end |
Instance Method Details
#accepted_analysis?(string) ⇒ Boolean
Checks if the string string
is accepted for analysis.
85 86 87 |
# File 'lib/sfst.rb', line 85 def accepted_analysis?(string) @fst._analyze(string) end |
#analyze(form) ⇒ Object Also known as: analyse
Analyses a string string
. Returns an array of analysed strings if the string is accepted or an empty array if not.
91 92 93 94 95 |
# File 'lib/sfst.rb', line 91 def analyze(form) x = [] @fst._analyze(form) { |a| x << a } x end |