Class: TM::ComplexEntry
- Inherits:
-
Object
- Object
- TM::ComplexEntry
- Defined in:
- lib/nysol/dictionary.rb
Overview
複合エントリクラス
Instance Attribute Summary collapse
-
#dPhrase ⇒ Object
readonly
用言句.
-
#iterNo ⇒ Object
辞書登録時のiterNo.
-
#polarity ⇒ Object
極性(数値:-1 or 1).
-
#pPhrase ⇒ Object
readonly
各助詞句.
-
#scFlag ⇒ Object
readonly
0:SimpleEntry, 1:ComplexEntry.
Instance Method Summary collapse
-
#initialize(dPhrase, pPhrase, polarity, iterNo = -1)) ⇒ ComplexEntry
constructor
A new instance of ComplexEntry.
- #show(fp = STDERR) ⇒ Object
-
#to_s ⇒ Object
entryを文字列化する(ex. “景気が回復する”) ====================================================.
Constructor Details
#initialize(dPhrase, pPhrase, polarity, iterNo = -1)) ⇒ ComplexEntry
Returns a new instance of ComplexEntry.
100 101 102 103 104 105 106 |
# File 'lib/nysol/dictionary.rb', line 100 def initialize(dPhrase, pPhrase, polarity, iterNo=-1) @scFlag = 1 @dPhrase = dPhrase @pPhrase = pPhrase @polarity = polarity @iterNo = iterNo end |
Instance Attribute Details
#dPhrase ⇒ Object (readonly)
用言句
95 96 97 |
# File 'lib/nysol/dictionary.rb', line 95 def dPhrase @dPhrase end |
#iterNo ⇒ Object
辞書登録時のiterNo
98 99 100 |
# File 'lib/nysol/dictionary.rb', line 98 def iterNo @iterNo end |
#polarity ⇒ Object
極性(数値:-1 or 1)
97 98 99 |
# File 'lib/nysol/dictionary.rb', line 97 def polarity @polarity end |
#pPhrase ⇒ Object (readonly)
各助詞句
96 97 98 |
# File 'lib/nysol/dictionary.rb', line 96 def pPhrase @pPhrase end |
#scFlag ⇒ Object (readonly)
0:SimpleEntry, 1:ComplexEntry
94 95 96 |
# File 'lib/nysol/dictionary.rb', line 94 def scFlag @scFlag end |
Instance Method Details
#show(fp = STDERR) ⇒ Object
115 116 117 118 119 120 |
# File 'lib/nysol/dictionary.rb', line 115 def show(fp=STDERR) fp.print "CE:" @dPhrase.show(fp) @pPhrase.show(fp) fp.print "(#{polarity})" end |
#to_s ⇒ Object
entryを文字列化する(ex. “景気が回復する”)
111 112 113 |
# File 'lib/nysol/dictionary.rb', line 111 def to_s return @dPhrase.to_s + @pPhrase.to_s end |