Class: TM::ComplexEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/nysol/dictionary.rb

Overview

複合エントリクラス

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dPhraseObject (readonly)

用言句



95
96
97
# File 'lib/nysol/dictionary.rb', line 95

def dPhrase
  @dPhrase
end

#iterNoObject

辞書登録時のiterNo



98
99
100
# File 'lib/nysol/dictionary.rb', line 98

def iterNo
  @iterNo
end

#polarityObject

極性(数値:-1 or 1)



97
98
99
# File 'lib/nysol/dictionary.rb', line 97

def polarity
  @polarity
end

#pPhraseObject (readonly)

各助詞句



96
97
98
# File 'lib/nysol/dictionary.rb', line 96

def pPhrase
  @pPhrase
end

#scFlagObject (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_sObject

entryを文字列化する(ex. “景気が回復する”)



111
112
113
# File 'lib/nysol/dictionary.rb', line 111

def to_s
	return @dPhrase.to_s + @pPhrase.to_s
end