public class XmlCorrectorController extends java.lang.Object implements Observable
Modifier and Type | Field and Description |
---|---|
boolean |
distance_verification |
boolean |
minimal |
int |
nb_correction_sequences |
int |
nb_edit_sequences |
int |
nb_result |
int |
nb_trees |
int |
nb_update_sequences |
java.lang.String |
prefix |
Tree |
t |
int |
threshold |
long |
time_cpu |
long |
time_end |
long |
time_first |
long |
time_start |
VocabTranslator |
tr |
java.util.HashMap<Tree,java.lang.Integer> |
tree_ids |
java.util.HashMap<Tree,java.util.Hashtable<java.lang.Integer,java.util.Collection<OperationSequence>>> |
tree_results |
TreeSchema |
ts |
int |
type |
boolean |
validation_verification |
Constructor and Description |
---|
XmlCorrectorController() |
Modifier and Type | Method and Description |
---|---|
void |
addObserver(Observer obs) |
void |
addTreeResult(Tree t,
OperationSequence os,
int cost)
Add the tree and the operationSequence that has given it to a Collection
|
java.lang.String |
correction(java.lang.String TreeSchema,
java.lang.String Tree,
int th,
boolean mminimal,
java.lang.String filename,
int addcost,
int relabelcost,
int removecost)
Correct the tree with these parameters
|
void |
createResultFile(java.util.Hashtable<java.lang.Integer,java.lang.Integer> n_to_cost)
Creates the global file result
|
java.util.Vector<java.lang.Integer> |
createResultFile(Result resultat)
Creates the result file for the given Result
|
void |
createResultFile(Tree tree)
Creates the file result for a given tree
|
java.lang.Integer |
getTreeId(Tree t)
Returns an unique id for a Tree.
|
java.lang.String |
initVariables(java.lang.String TreeSchema,
java.lang.String Tree,
int th,
boolean mminimal,
java.lang.String filename,
int addcost,
int relabelcost,
int removecost)
Initialize the variables
|
void |
notifyObserver(java.lang.String str) |
void |
parseFile(java.io.File file)
Parse the file given, it should be a XmlCorrectorControler conform to the
DTD
|
void |
parseTreeSchema(org.jdom.Element e)
Generates a TreeSchema using the Element e given.
|
void |
removeObserver() |
void |
resultVerification(OperationSequence os,
int cost)
Verifies that the tree made from the OperationSequence is correct / has
the correct cost
|
public TreeSchema ts
public Tree t
public int threshold
public java.lang.String prefix
public int type
public boolean minimal
public boolean validation_verification
public boolean distance_verification
public long time_start
public long time_end
public long time_first
public long time_cpu
public int nb_result
public int nb_trees
public int nb_correction_sequences
public int nb_update_sequences
public int nb_edit_sequences
public java.util.HashMap<Tree,java.util.Hashtable<java.lang.Integer,java.util.Collection<OperationSequence>>> tree_results
public java.util.HashMap<Tree,java.lang.Integer> tree_ids
public VocabTranslator tr
public void parseTreeSchema(org.jdom.Element e) throws XmlControlerException, addSchemaException, generatedSchemaException, badSchemaException
e
- Element to useXmlControlerException
addSchemaException
generatedSchemaException
badSchemaException
public void parseFile(java.io.File file) throws java.lang.Exception
file
- File to usejava.lang.Exception
public java.lang.Integer getTreeId(Tree t)
t
- Tree to use to get the IDpublic void addTreeResult(Tree t, OperationSequence os, int cost)
t
- Tree to Addos
- OperationSequence to docost
- Cost of the OperationSequencepublic void resultVerification(OperationSequence os, int cost) throws invalidResultFoundException, addNodeException, noNodeException, removeNodeException, badAddressException, headerNodeException, abstractOperationException, onlyCharactersException, badOperationException, invalidDistanceResultFoundException
os
- OperationSequence to usecost
- Cost of the OperationSequence (logically)invalidResultFoundException
- Throws this if the Tree found isn't validinvalidDistanceResultFoundException
- Throws this if the distance between the Tree found and the
original tree isn't the logical costaddNodeException
noNodeException
removeNodeException
badAddressException
headerNodeException
abstractOperationException
onlyCharactersException
badOperationException
public void createResultFile(java.util.Hashtable<java.lang.Integer,java.lang.Integer> n_to_cost)
n_to_cost
- Hashtable that associates a cost to a file numberpublic void createResultFile(Tree tree)
tree
- public java.util.Vector<java.lang.Integer> createResultFile(Result resultat) throws badOperationException, badAddressException, noNodeException, headerNodeException, addNodeException, removeNodeException, abstractOperationException, invalidResultFoundException, onlyCharactersException, invalidDistanceResultFoundException
resultat
- Result to usebadOperationException
badAddressException
noNodeException
headerNodeException
addNodeException
removeNodeException
abstractOperationException
invalidResultFoundException
onlyCharactersException
invalidDistanceResultFoundException
public java.lang.String initVariables(java.lang.String TreeSchema, java.lang.String Tree, int th, boolean mminimal, java.lang.String filename, int addcost, int relabelcost, int removecost) throws java.lang.Exception
TreeSchema
- Tree
- th
- mminimal
- filename
- addcost
- relabelcost
- removecost
- java.lang.Exception
public java.lang.String correction(java.lang.String TreeSchema, java.lang.String Tree, int th, boolean mminimal, java.lang.String filename, int addcost, int relabelcost, int removecost)
TreeSchema
- Tree
- th
- mminimal
- filename
- addcost
- relabelcost
- removecost
- public void addObserver(Observer obs)
addObserver
in interface Observable
public void notifyObserver(java.lang.String str)
notifyObserver
in interface Observable
public void removeObserver()
removeObserver
in interface Observable