Class: TM::SimpleEntryCand
- Inherits:
-
Object
- Object
- TM::SimpleEntryCand
- Defined in:
- lib/nysol/dictionary.rb
Instance Attribute Summary collapse
-
#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.
-
#sEntry ⇒ Object
readonly
Returns the value of attribute sEntry.
-
#suppFlg ⇒ Object
エントリの出現が一定以上.
-
#ttlCount ⇒ Object
Returns the value of attribute ttlCount.
Instance Method Summary collapse
- #countUp(pol) ⇒ Object
-
#initialize(entry, pol) ⇒ SimpleEntryCand
constructor
A new instance of SimpleEntryCand.
- #prob(pol) ⇒ Object
- #show(fp = STDERR) ⇒ Object
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
#conf ⇒ Object
エントリの出現中の極性出現が一定以上
132 133 134 |
# File 'lib/nysol/dictionary.rb', line 132 def conf @conf end |
#confFlg ⇒ Object
エントリの出現中の極性出現が一定以上
131 132 133 |
# File 'lib/nysol/dictionary.rb', line 131 def confFlg @confFlg end |
#negCount ⇒ Object
Returns the value of attribute negCount.
126 127 128 |
# File 'lib/nysol/dictionary.rb', line 126 def negCount @negCount end |
#polarity ⇒ Object
Returns the value of attribute polarity.
130 131 132 |
# File 'lib/nysol/dictionary.rb', line 130 def polarity @polarity end |
#posCount ⇒ Object
Returns the value of attribute posCount.
125 126 127 |
# File 'lib/nysol/dictionary.rb', line 125 def posCount @posCount end |
#sEntry ⇒ Object (readonly)
Returns the value of attribute sEntry.
124 125 126 |
# File 'lib/nysol/dictionary.rb', line 124 def sEntry @sEntry end |
#suppFlg ⇒ Object
エントリの出現が一定以上
129 130 131 |
# File 'lib/nysol/dictionary.rb', line 129 def suppFlg @suppFlg end |
#ttlCount ⇒ Object
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 |