lib/NATO/text.rb in NATO-0.0.2 vs lib/NATO/text.rb in NATO-0.0.3
- old
+ new
@@ -1,10 +1,22 @@
class NATO::Text
- attr_reader :original, :natified
+ attr_reader :original, :natified, :pronunciation
def initialize(sentence)
@original = sentence
- @natified = NATO::Parser.instance.natify sentence
+
+ sentence_natified = NATO::Parser.instance.natify sentence
+
+ @natified = sentence_natified.map { |item| item.first }.join ' '
+ @pronunciation = sentence_natified.map { |item| item.last }.join ' '
+ end
+
+ def natified
+ @natified ||= ''
+ end
+
+ def pronunciation
+ @pronunciation ||= ''
end
def to_nato
@natified
end
\ No newline at end of file