ir.vsr
Class HashMapPosVector

java.lang.Object
  |
  +--ir.vsr.HashMapVector
        |
        +--ir.vsr.HashMapPosVector

public class HashMapPosVector
extends HashMapVector

A data structure for a "positional" term vector for a document stored as a HashMap that maps tokens to ArrayList's of Integer's which are the positions of the token in the document.


Fields inherited from class ir.vsr.HashMapVector
hashMap
 
Constructor Summary
HashMapPosVector()
           
 
Method Summary
 void add(HashMapVector vector)
          Destructively add the given vector to the current vector
 void addPosition(java.lang.String token, int position)
          Add a new position occurence of a token to the vector
 HashMapVector copy()
          Produce a copy of this HashMapVector with a new HashMap and new Weight's
 double increment(java.lang.String token, int amount)
          Increment the count for the given token in the vector by the given amount.
 void multiply(int factor)
          Destructively multiply the vector by a constant
 void print()
          Print out the vector showing the tokens and their positions
 void subtract(HashMapVector vector)
          Destructively subtract the given vector from the current vector
 
Methods inherited from class ir.vsr.HashMapVector
cosineDistanceTo, increment, increment, iterator, maxWeight, multiply, size, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HashMapPosVector

public HashMapPosVector()
Method Detail

increment

public double increment(java.lang.String token,
                        int amount)
Increment the count for the given token in the vector by the given amount.
Overrides:
increment in class HashMapVector

addPosition

public void addPosition(java.lang.String token,
                        int position)
Add a new position occurence of a token to the vector

add

public void add(HashMapVector vector)
Destructively add the given vector to the current vector
Overrides:
add in class HashMapVector

subtract

public void subtract(HashMapVector vector)
Destructively subtract the given vector from the current vector
Overrides:
subtract in class HashMapVector

multiply

public void multiply(int factor)
Destructively multiply the vector by a constant

copy

public HashMapVector copy()
Produce a copy of this HashMapVector with a new HashMap and new Weight's
Overrides:
copy in class HashMapVector

print

public void print()
Print out the vector showing the tokens and their positions
Overrides:
print in class HashMapVector