Class consisting of traversing method and compare method.
More...
|
UpdatableFragment | selectBestPart (UpdatableFragment origFragment, UpdatableFragment newFragment) throws XPathExpressionException |
|
int | countWordsLengthBeg (int count, String words[]) |
|
int | countWordsLengthEnd (int count, String words[], int wholeLength) |
|
UpdatableFragment | selectBestSubFragment (UpdatableFragment origFragment, ArrayList< UpdatableFragment > BestSubParts) throws XPathExpressionException |
|
UpdatableFragment | wordMatchMethod (Node node, UpdatableFragment queryFragment) throws XPathExpressionException |
|
UpdatableFragment | firstAndLastWordMatchMethod (Node node, UpdatableFragment queryFragment, ArrayList< IndexAndlength > firstWordsHit, ArrayList< IndexAndlength > lastWordsHit) throws XPathExpressionException |
|
Integer | matchFirstWord (String[] nodeWords, String firstWord, String lastWord, IndexAndlength IaL, ArrayList< IndexAndlength > firstWordsHit, ArrayList< IndexAndlength > lastWordsHit) |
|
UpdatableFragment | matchLastWord (String[] nodeWords, String word, IndexAndlength IaL, int maxLength, int minLength, String XPath) throws XPathExpressionException |
|
String | createFragmentStringFromWords (String[] words, int firstWordIndex, int lastWordIndex) |
|
UpdatableFragment | firstAndLastLetterMatchMethod (Node node, UpdatableFragment queryFragment, ArrayList< IndexAndlength > firstWordsHit, ArrayList< IndexAndlength > lastWordsHit) throws XPathExpressionException |
|
UpdatableFragment | matchSameLastLetter (String[] nodeWords, String word, IndexAndlength IaL, int maxLength, int minLength, String XPath) throws XPathExpressionException |
|
UpdatableFragment | matchSameFirstLetter (String[] nodeWords, String word, IndexAndlength IaL, int maxLength, int minLength, String XPath) throws XPathExpressionException |
|
UpdatableFragment | matchMostSimiliar (String[] nodeWords, IndexAndlength IaL, int maxLength, int minLength, String XPath, String originalFragment) throws XPathExpressionException |
|
Class consisting of traversing method and compare method.
Comparator class consisting of traversing method and compare method
- Author
- Michael Angelov
Definition at line 37 of file Comparator.java.
Constructor
- Parameters
-
compareMethod | compare method used to determine if strings match |
traversingMethod | traversing method in strings |
Definition at line 91 of file Comparator.java.
cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.Comparator |
( |
CompareMethod |
compareMethod, |
|
|
TraversingMethod |
traversingMethod, |
|
|
double |
maxLenghtEnlargement, |
|
|
double |
maxLenghtReduction |
|
) |
| |
Constructor
- Parameters
-
compareMethod | compare method used to determine if strings match |
traversingMethod | traversing method in strings |
maxLenghtEnlargement | maximum annotation length enlargement |
maxLenghtReduction | maximum annotation length reduction |
Definition at line 104 of file Comparator.java.
Fragment compare method
- Parameters
-
queryFragment | fragment to be matched in node |
node | node in which string content of queryFrament should be matched |
- Returns
- result fragment, null if there was no match
Definition at line 148 of file Comparator.java.
int cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.countWordsLengthBeg |
( |
int |
count, |
|
|
String |
words[] |
|
) |
| |
|
private |
What is the offset of the n-th word from the beginning in the string with gaps?
- Parameters
-
- Returns
- offset of the n-th word from the beginning od the string
Definition at line 407 of file Comparator.java.
int cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.countWordsLengthEnd |
( |
int |
count, |
|
|
String |
words[], |
|
|
int |
wholeLength |
|
) |
| |
|
private |
What is the offset of the n-th word from the end in the string with gaps?
- Parameters
-
count | n |
words | All words |
wholeLength | Length of the whole string with gaps |
- Returns
- offset of the n-th word from the end od the string
Definition at line 423 of file Comparator.java.
String cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.createFragmentStringFromWords |
( |
String[] |
words, |
|
|
int |
firstWordIndex, |
|
|
int |
lastWordIndex |
|
) |
| |
|
private |
Creates a new fragment string from the words in array words. Inserts spaces between the words.
- Parameters
-
words | Words array used for the creation of the fragment string |
firstWordIndex | Index of the first word. |
lastWordIndex | Index of the last word. |
- Returns
- String with the new fragment.
Definition at line 698 of file Comparator.java.
Method which is matching first or last word and last or first letter of the original fragment It's based in similiar idea as firstAndLastWordMatchMethod
- Parameters
-
node | node in which string content of queryFrament should be matched |
queryFragment | fragment to be matched in node |
firstWordsHit | Initialized arraylist with stored first words of the fragment match hit in the node. |
lastWordsHit | Initialized arraylist with stored last words of the fragment match hit in the node. |
- Returns
- result fragment, null if there was no match
- Exceptions
-
Definition at line 722 of file Comparator.java.
Method which is matching first and last word of the original fragment
- Parameters
-
node | node in which string content of queryFrament should be matched |
queryFragment | fragment to be matched in node |
firstWordsHit | Initialized arraylist for storing first word of the fragment match hit in the node. |
lastWordsHit | Initialized arraylist for storing last word of the fragment match hit in the node. |
- Returns
- result fragment, null if there was no match
- Exceptions
-
Definition at line 565 of file Comparator.java.
CompareMethod cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.getCompareMethod |
( |
| ) |
|
Getter for compare method used in comparator
- Returns
- compare method used in comparator
Definition at line 71 of file Comparator.java.
static String cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.getNodeContent |
( |
Node |
node | ) |
|
|
static |
Gets content of XML node
- Parameters
-
- Returns
- If it's text node or CDATA, returns textual content of XML node, null otherwise
Definition at line 289 of file Comparator.java.
TraversingMethod cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.getTraversingMethod |
( |
| ) |
|
Getter for traversing method used in comparator
- Returns
- traversing method used in comparator
Definition at line 62 of file Comparator.java.
Integer cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.matchFirstWord |
( |
String[] |
nodeWords, |
|
|
String |
firstWord, |
|
|
String |
lastWord, |
|
|
IndexAndlength |
IaL, |
|
|
ArrayList< IndexAndlength > |
firstWordsHit, |
|
|
ArrayList< IndexAndlength > |
lastWordsHit |
|
) |
| |
|
private |
Finds the first occurrence of the word in the String array nodeWords
- Parameters
-
nodeWords | Words of the node |
firstWord | First word which we are looking for |
lastWord | Last word which we are looking for |
IaL | Variable with the starting index and the starting offset |
firstWordsHit | Array to which found positions of first word will be stored |
lastWordsHit | Array to which found positions of last word will be stored |
- Returns
- new offset
Definition at line 629 of file Comparator.java.
UpdatableFragment cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.matchLastWord |
( |
String[] |
nodeWords, |
|
|
String |
word, |
|
|
IndexAndlength |
IaL, |
|
|
int |
maxLength, |
|
|
int |
minLength, |
|
|
String |
XPath |
|
) |
| throws XPathExpressionException |
|
private |
Finds the last occurrence of the word in the String array nodeWords
- Parameters
-
nodeWords | Words of the node |
word | Word which we are looking for |
IaL | Variable with the starting index and the starting offset |
maxLength | Maximum length of the new fragment |
minLength | Minimal length of the new fragment |
XPath | New fragment XPath |
- Returns
- New fragment or null if no fragment was found.
- Exceptions
-
Definition at line 663 of file Comparator.java.
UpdatableFragment cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.matchMostSimiliar |
( |
String[] |
nodeWords, |
|
|
IndexAndlength |
IaL, |
|
|
int |
maxLength, |
|
|
int |
minLength, |
|
|
String |
XPath, |
|
|
String |
originalFragment |
|
) |
| throws XPathExpressionException |
|
private |
Method creates a fragment with most compatible words and the least levenstein distance from original fragment.
- Parameters
-
nodeWords | Words of the node |
IaL | Variable with the starting index and the starting offset |
maxLength | Maximum length of the new fragment |
minLength | Minimum length of the new fragment |
XPath | New fragment XPath |
originalFragment | Text of the original fragment |
- Returns
- New fragment or null if no fragment was found.
- Exceptions
-
Definition at line 876 of file Comparator.java.
UpdatableFragment cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.matchSameFirstLetter |
( |
String[] |
nodeWords, |
|
|
String |
word, |
|
|
IndexAndlength |
IaL, |
|
|
int |
maxLength, |
|
|
int |
minLength, |
|
|
String |
XPath |
|
) |
| throws XPathExpressionException |
|
private |
Method searches backwards for the first word with the same first letter as the word in parameter word.
- Parameters
-
nodeWords | Words of the node |
word | Word which we are looking for |
IaL | Variable with the starting index and the starting offset |
maxLength | Maximum length of the new fragment |
minLength | Minimal length of the new fragment |
XPath | New fragment XPath |
- Returns
- New fragment or null if no fragment was found.
- Exceptions
-
Definition at line 834 of file Comparator.java.
UpdatableFragment cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.matchSameLastLetter |
( |
String[] |
nodeWords, |
|
|
String |
word, |
|
|
IndexAndlength |
IaL, |
|
|
int |
maxLength, |
|
|
int |
minLength, |
|
|
String |
XPath |
|
) |
| throws XPathExpressionException |
|
private |
Method searches for the first word with the same last letter as the word in parameter word.
- Parameters
-
nodeWords | Words of the node |
word | Word which we are looking for |
IaL | Variable with the starting index and the starting offset |
maxLength | Maximum length of the new fragment |
minLength | Minimal length of the new fragment |
XPath | New fragment XPath |
- Returns
- New fragment or null if no fragment was found.
- Exceptions
-
Definition at line 793 of file Comparator.java.
Selects the best substrings of the new matched fragment. Best == least different from the original fragment
- Parameters
-
origFragment | Original fragment |
newFragment | Matched fragment |
- Returns
- least different part of the matched fragment
- Exceptions
-
Definition at line 309 of file Comparator.java.
Selects the best fragment from the best substrings
- Parameters
-
origFragment | Original fragment |
BestSubParts | Best substrings |
- Returns
- New selected fragment
- Exceptions
-
Definition at line 439 of file Comparator.java.
void cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.setmaxLenghtEnlargement |
( |
double |
maxLenghtEnlargement | ) |
|
Setter for maximum annotation length enlargement used in FIRST_AND_LAST_WORD method
- Parameters
-
maxLenghtEnlargement | maximum annotation length enlargement |
Definition at line 81 of file Comparator.java.
String cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.toString |
( |
| ) |
|
Method which is matching over all words of the fragment
- Parameters
-
node | node in which string content of queryFrament should be matched |
queryFragment | fragment to be matched in node |
- Returns
- result fragment, null if there was no match
- Exceptions
-
Definition at line 488 of file Comparator.java.
CompareMethod cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.compareMethod |
|
private |
double cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.maxLenghtEnlargement = 1.5 |
|
private |
Maximal enlargement of fragment length
Definition at line 53 of file Comparator.java.
double cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.maxLenghtReduction = 0.5 |
|
private |
TraversingMethod cz.vutbr.fit.knot.annotations.fragmentUpdater.Comparator.traversingMethod |
|
private |
The documentation for this class was generated from the following file: