Class: TM::ComplexEntryCand

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry, pol) ⇒ ComplexEntryCand

Returns a new instance of ComplexEntryCand.



181
182
183
184
185
186
187
188
189
190
191
# File 'lib/nysol/dictionary.rb', line 181

def initialize(entry,pol)
	@cEntry=entry
	@posCount=0
	@negCount=0
	@ttlCount=0
	@posCount=1 if pol == +1
	@negCount=1 if pol == -1
	@suppFlg =false
	@polarity=0
	@confFlg =false
end

Instance Attribute Details

#cEntryObject (readonly)

Returns the value of attribute cEntry.



171
172
173
# File 'lib/nysol/dictionary.rb', line 171

def cEntry
  @cEntry
end

#confObject

エントリの出現中の極性出現が一定以上



179
180
181
# File 'lib/nysol/dictionary.rb', line 179

def conf
  @conf
end

#confFlgObject

エントリの出現中の極性出現が一定以上



178
179
180
# File 'lib/nysol/dictionary.rb', line 178

def confFlg
  @confFlg
end

#negCountObject

Returns the value of attribute negCount.



173
174
175
# File 'lib/nysol/dictionary.rb', line 173

def negCount
  @negCount
end

#polarityObject

Returns the value of attribute polarity.



176
177
178
# File 'lib/nysol/dictionary.rb', line 176

def polarity
  @polarity
end

#posCountObject

Returns the value of attribute posCount.



172
173
174
# File 'lib/nysol/dictionary.rb', line 172

def posCount
  @posCount
end

#suppFlgObject

エントリの出現が一定以上



177
178
179
# File 'lib/nysol/dictionary.rb', line 177

def suppFlg
  @suppFlg
end

#ttlCountObject

Returns the value of attribute ttlCount.



174
175
176
# File 'lib/nysol/dictionary.rb', line 174

def ttlCount
  @ttlCount
end

Instance Method Details

#countUp(pol) ⇒ Object



193
194
195
196
# File 'lib/nysol/dictionary.rb', line 193

def countUp(pol)
	@posCount+=1 if pol== +1
	@negCount+=1 if pol== -1
end

#prob(pol) ⇒ Object



198
199
200
201
202
203
204
205
# File 'lib/nysol/dictionary.rb', line 198

def prob(pol)
	if    pol== 1 then
		return posCount/ttlCount
	elsif pol==-1 then
		return negCount/ttlCount
	end
	return -1
end

#show(fp = STDERR) ⇒ Object



207
208
209
210
211
212
# File 'lib/nysol/dictionary.rb', line 207

def show(fp=STDERR)
	#return if @posCount==0 and @negCount==0
	#return if not @suppFlg
	@cEntry.show(fp)
	fp.puts " (pc=#{@posCount},nc=#{@negCount},oc=#{@ttlCount-@posCount-@negCount},tc=#{@ttlCount}) (sup=#{@suppFlg} pol=#{@polarity} con=#{@confFlg}[#{@conf}])"
end