Class: JSGF::Rule
- Inherits:
-
Array
- Object
- Array
- JSGF::Rule
- Defined in:
- lib/jsgf/rule.rb
Class Method Summary collapse
-
.parse_atom(atom) ⇒ Object
Convert a string containing a single atom into an Atom or a rule reference.
Class Method Details
.parse_atom(atom) ⇒ Object
Convert a string containing a single atom into an Atom or a rule reference
5 6 7 8 9 10 11 |
# File 'lib/jsgf/rule.rb', line 5 def self.parse_atom(atom) case atom when /\<(.*)\>/, /:(.*)/ then {name:$1, weight:1.0, tags:[]} else Atom.new(atom) end end |