classifier
Class TabellaIntorni
java.lang.Object
|
+--classifier.TabellaIntorni
- public class TabellaIntorni
- extends java.lang.Object
Implement neighborhood table, which associates a pair
for each term, where match is the matching word and weight is the weight of
the match.
A term is a (sequence of) words.
Field Summary |
int |
maxLength
Max lenght for titles or neighbour terms |
Constructor Summary |
TabellaIntorni(java.lang.String nomeFile)
Legge una neighborhood table da file. |
Method Summary |
void |
addWords(java.util.Enumeration e)
This function is called to add each word in a category title with self
as neighbour
This is because the phrase analyzer discards any word not
present in any neighborhood
It also counts words in title. |
boolean |
exists(java.lang.String word)
|
float |
get(java.lang.String term1,
java.lang.String term2)
|
java.util.Hashtable |
getIntorni()
|
java.util.Enumeration |
keys()
|
void |
update(java.lang.String word,
java.lang.String key,
float weight)
Updates neighborhood table adding pair
in corresposndece to word key. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
maxLength
public int maxLength
- Max lenght for titles or neighbour terms
TabellaIntorni
public TabellaIntorni(java.lang.String nomeFile)
- Legge una neighborhood table da file.
Il file e' organizzato come segue:
term1
term1,1 , w1,1
term1,2 , w1,2
...
term1,N1 , w1,N1
...
termM
termM,1 , wM,1
...
termM,NM , wM,NM
Il termI,J e' nell'intorno di termI con peso wI,J.
I terminiI iniziano alla prima colonna.
Le righe contenenti i terminiI,J iniziano con un carattere di tabulazione.
Le linee che iniziano con # sono scartate.
Si assume che i termini siano stati gia' normalizzati.
getIntorni
public java.util.Hashtable getIntorni()
exists
public boolean exists(java.lang.String word)
addWords
public void addWords(java.util.Enumeration e)
- This function is called to add each word in a category title with self
as neighbour
This is because the phrase analyzer discards any word not
present in any neighborhood
It also counts words in title.
update
public void update(java.lang.String word,
java.lang.String key,
float weight)
- Updates neighborhood table adding pair
in corresposndece to word key.
Se esiste gia' una coppia si limita
ad aggiornare il peso.
get
public float get(java.lang.String term1,
java.lang.String term2)
- Returns:
- il peso di term1 rispetto a term2.
keys
public java.util.Enumeration keys()
- Returns:
- Enumeration of keys in table.