Class: TM::ComplexEntryCand
- Inherits:
-
Object
- Object
- TM::ComplexEntryCand
- Defined in:
- lib/nysol/dictionary.rb
Instance Attribute Summary collapse
-
#cEntry ⇒ Object
readonly
Returns the value of attribute cEntry.
-
#conf ⇒ Object
エントリの出現中の極性出現が一定以上.
-
#confFlg ⇒ Object
エントリの出現中の極性出現が一定以上.
-
#negCount ⇒ Object
Returns the value of attribute negCount.
-
#polarity ⇒ Object
Returns the value of attribute polarity.
-
#posCount ⇒ Object
Returns the value of attribute posCount.
-
#suppFlg ⇒ Object
エントリの出現が一定以上.
-
#ttlCount ⇒ Object
Returns the value of attribute ttlCount.
Instance Method Summary collapse
- #countUp(pol) ⇒ Object
-
#initialize(entry, pol) ⇒ ComplexEntryCand
constructor
A new instance of ComplexEntryCand.
- #prob(pol) ⇒ Object
- #show(fp = STDERR) ⇒ Object
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
#cEntry ⇒ Object (readonly)
Returns the value of attribute cEntry.
171 172 173 |
# File 'lib/nysol/dictionary.rb', line 171 def cEntry @cEntry end |
#conf ⇒ Object
エントリの出現中の極性出現が一定以上
179 180 181 |
# File 'lib/nysol/dictionary.rb', line 179 def conf @conf end |
#confFlg ⇒ Object
エントリの出現中の極性出現が一定以上
178 179 180 |
# File 'lib/nysol/dictionary.rb', line 178 def confFlg @confFlg end |
#negCount ⇒ Object
Returns the value of attribute negCount.
173 174 175 |
# File 'lib/nysol/dictionary.rb', line 173 def negCount @negCount end |
#polarity ⇒ Object
Returns the value of attribute polarity.
176 177 178 |
# File 'lib/nysol/dictionary.rb', line 176 def polarity @polarity end |
#posCount ⇒ Object
Returns the value of attribute posCount.
172 173 174 |
# File 'lib/nysol/dictionary.rb', line 172 def posCount @posCount end |
#suppFlg ⇒ Object
エントリの出現が一定以上
177 178 179 |
# File 'lib/nysol/dictionary.rb', line 177 def suppFlg @suppFlg end |
#ttlCount ⇒ Object
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 |