Class: Camdict::Explanation::Sentence
- Inherits:
-
Object
- Object
- Camdict::Explanation::Sentence
- Includes:
- Common
- Defined in:
- lib/camdict/explanation.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.
106 107 108 109 110 |
# File 'lib/camdict/explanation.rb', line 106 def initialize(html) @html = html @usage = get_usage @sentence = get_sentence end |
Instance Attribute Details
#sentence ⇒ Object (readonly)
Get one sentence inside an example block.
103 104 105 |
# File 'lib/camdict/explanation.rb', line 103 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.
100 101 102 |
# File 'lib/camdict/explanation.rb', line 100 def usage @usage end |