Class: TM::SimpleEntryCand

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry, pol) ⇒ SimpleEntryCand

Returns a new instance of SimpleEntryCand.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/nysol/dictionary.rb', line 134

def initialize(entry,pol)
#entry.show
#puts "pol=#{pol}"
	@sEntry=entry
#puts "sec_new=#{entry.iterNo}"
	@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

#confObject

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



132
133
134
# File 'lib/nysol/dictionary.rb', line 132

def conf
  @conf
end

#confFlgObject

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



131
132
133
# File 'lib/nysol/dictionary.rb', line 131

def confFlg
  @confFlg
end

#negCountObject

Returns the value of attribute negCount.



126
127
128
# File 'lib/nysol/dictionary.rb', line 126

def negCount
  @negCount
end

#polarityObject

Returns the value of attribute polarity.



130
131
132
# File 'lib/nysol/dictionary.rb', line 130

def polarity
  @polarity
end

#posCountObject

Returns the value of attribute posCount.



125
126
127
# File 'lib/nysol/dictionary.rb', line 125

def posCount
  @posCount
end

#sEntryObject (readonly)

Returns the value of attribute sEntry.



124
125
126
# File 'lib/nysol/dictionary.rb', line 124

def sEntry
  @sEntry
end

#suppFlgObject

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



129
130
131
# File 'lib/nysol/dictionary.rb', line 129

def suppFlg
  @suppFlg
end

#ttlCountObject

Returns the value of attribute ttlCount.



127
128
129
# File 'lib/nysol/dictionary.rb', line 127

def ttlCount
  @ttlCount
end

Instance Method Details

#countUp(pol) ⇒ Object



149
150
151
152
# File 'lib/nysol/dictionary.rb', line 149

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

#prob(pol) ⇒ Object



154
155
156
157
158
159
160
161
# File 'lib/nysol/dictionary.rb', line 154

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

#show(fp = STDERR) ⇒ Object



163
164
165
166
167
# File 'lib/nysol/dictionary.rb', line 163

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