Class: Camdict::Sentence
- Inherits:
-
Object
- Object
- Camdict::Sentence
- Includes:
- Common
- Defined in:
- lib/camdict/sentence.rb
Overview
Parse the html to get the example sentence and its typical usage information associated with this sentence.
Instance Attribute Summary collapse
-
#sentence ⇒ Object
readonly
Get one sentence inside an example block.
-
#usage ⇒ Object
readonly
Get the grammar code or usage in this sentence.
Instance Method Summary collapse
-
#initialize(html) ⇒ Sentence
constructor
New a sentence object from
html
containing the eg block.
Constructor Details
#initialize(html) ⇒ Sentence
New a sentence object from html
containing the eg block.
18 19 20 21 |
# File 'lib/camdict/sentence.rb', line 18 def initialize(html) @usage = get_usage(html) @sentence = get_sentence(html) end |
Instance Attribute Details
#sentence ⇒ Object (readonly)
Get one sentence inside an example block.
15 16 17 |
# File 'lib/camdict/sentence.rb', line 15 def sentence @sentence end |
#usage ⇒ Object (readonly)
Get the grammar code or usage in this sentence. It means how the word is used in this sentence. For example, a grammar code for the word - ‘somewhere’ is “+to infinitive”. I’m looking for somewhere to eat.
12 13 14 |
# File 'lib/camdict/sentence.rb', line 12 def usage @usage end |