4A Server -
2.0
|
Class providing access to available matchers. More...
Public Member Functions | |
MatcherProvider () | |
void | add (Matcher matcher, int priority) |
void | add (MatcherWrapper mw) |
void | remove (MatcherWrapper mw) |
void | removeMatcher (Matcher matcher) |
ArrayList< MatcherWrapper > | getMatcherWrappers () |
UpdatableFragment | match (String text, UpdatableFragment queryFragment) throws ParserConfigurationException, SAXException, IOException, XPathExpressionException |
UpdatableFragment | match (Document document, UpdatableFragment queryFragment) throws XPathExpressionException |
ArrayList< UpdatableFragment > | matchAll (Document document, UpdatableFragment queryFragment) throws XPathExpressionException |
ArrayList< UpdatableFragment > | matchAllIncrementally (Document document, UpdatableFragment queryFragment) throws XPathExpressionException |
UpdatableFragment | matchInClosestNode (Document document, UpdatableFragment queryFragment) throws XPathExpressionException |
ArrayList< UpdatableFragment > | matchIn3ClosestNodes (Document document, UpdatableFragment queryFragment) throws XPathExpressionException |
void | sortMatchers () |
void | removeAll () |
Document | getDocumentFromString (String text, boolean setNamespaces, boolean setErrors) throws ParserConfigurationException, SAXException, IOException |
DocumentFragment | getFragmentFromString (String text) throws ParserConfigurationException, SAXException, IOException |
Public Attributes | |
ArrayList< MatcherWrapper > | matcherWrappers |
Static Protected Attributes | |
static final String | _SET_NAMESPACES = "http://xml.org/sax/features/namespaces" |
static final String | _REPORT_ERRORS = "http://cyberneko.org/html/features/report-errors" |
Private Member Functions | |
Node | getFirstTextNode (Node firstNode) |
UpdatableFragment | selectBestSubFragment (UpdatableFragment origFragment, ArrayList< UpdatableFragment > BestSubParts) throws XPathExpressionException |
Class providing access to available matchers.
Class providing access to available matchers
Definition at line 44 of file MatcherProvider.java.
cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.MatcherProvider | ( | ) |
Constructor
Definition at line 54 of file MatcherProvider.java.
void cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.add | ( | Matcher | matcher, |
int | priority | ||
) |
Method for adding matcher to list of provided matchers
matcher | matcher to be added |
priority | priority of matcher |
Definition at line 64 of file MatcherProvider.java.
void cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.add | ( | MatcherWrapper | mw | ) |
Method for adding matcher wrapper
mw | matcher wrapper to be added |
Definition at line 74 of file MatcherProvider.java.
Document cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.getDocumentFromString | ( | String | text, |
boolean | setNamespaces, | ||
boolean | setErrors | ||
) | throws ParserConfigurationException, SAXException, IOException |
Converts given string into Document
text | String to convert |
setNamespaces | Flag for setting namespaces to parser |
setErrors | Flag for setting errors report to parser |
Definition at line 375 of file MatcherProvider.java.
|
private |
Method finds the first text node of a document
firstNode | Document first node |
Definition at line 329 of file MatcherProvider.java.
DocumentFragment cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.getFragmentFromString | ( | String | text | ) | throws ParserConfigurationException, SAXException, IOException |
Converts given string into Document fragment
text | String to convert |
Definition at line 398 of file MatcherProvider.java.
ArrayList<MatcherWrapper> cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.getMatcherWrappers | ( | ) |
Getter for list of provided matchers
Definition at line 111 of file MatcherProvider.java.
UpdatableFragment cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.match | ( | String | text, |
UpdatableFragment | queryFragment | ||
) | throws ParserConfigurationException, SAXException, IOException, XPathExpressionException |
Method for matching query fragment in document
text | text in which fragment should be matched |
queryFragment | fragment to be matched |
Definition at line 122 of file MatcherProvider.java.
UpdatableFragment cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.match | ( | Document | document, |
UpdatableFragment | queryFragment | ||
) | throws XPathExpressionException |
Method for matching query fragment in document
document | Document in which fragment should be matched |
queryFragment | fragment to be matched |
Definition at line 141 of file MatcherProvider.java.
ArrayList<UpdatableFragment> cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.matchAll | ( | Document | document, |
UpdatableFragment | queryFragment | ||
) | throws XPathExpressionException |
Method for matching query fragment in document
document | Document in which fragment should be matched |
queryFragment | fragment to be matched |
Definition at line 159 of file MatcherProvider.java.
ArrayList<UpdatableFragment> cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.matchAllIncrementally | ( | Document | document, |
UpdatableFragment | queryFragment | ||
) | throws XPathExpressionException |
Method for matching query fragment in document
document | Document in which fragment should be matched |
queryFragment | fragment to be matched |
Definition at line 182 of file MatcherProvider.java.
ArrayList<UpdatableFragment> cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.matchIn3ClosestNodes | ( | Document | document, |
UpdatableFragment | queryFragment | ||
) | throws XPathExpressionException |
Method for matching query fragment in document This method should be used only with bidirectional iterator! Bidirectional iterator has a it's own mechanism for traversing the nodes.
document | Document in which fragment should be matched |
queryFragment | fragment to be matched |
Definition at line 251 of file MatcherProvider.java.
UpdatableFragment cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.matchInClosestNode | ( | Document | document, |
UpdatableFragment | queryFragment | ||
) | throws XPathExpressionException |
Method for matching query fragment in document This method should be used only with bidirectional iterator! Bidirectional iterator has a it's own mechanism for traversing the nodes.
document | Document in which fragment should be matched |
queryFragment | fragment to be matched |
Definition at line 212 of file MatcherProvider.java.
void cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.remove | ( | MatcherWrapper | mw | ) |
Method for removing matcher wrapper from list
mw | matcher to be removed |
Definition at line 84 of file MatcherProvider.java.
void cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.removeAll | ( | ) |
Method for removing all matchers
Definition at line 363 of file MatcherProvider.java.
void cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.removeMatcher | ( | Matcher | matcher | ) |
Method for removing matcher from provided matcher list
matcher | matcher to be removed |
Definition at line 94 of file MatcherProvider.java.
|
private |
Selects the best fragment from the best substrings
origFragment | Original fragment |
BestSubParts | Best substrings |
XPathExpressionException |
Definition at line 419 of file MatcherProvider.java.
void cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.sortMatchers | ( | ) |
Method for sorting matcher according to their priority
Definition at line 346 of file MatcherProvider.java.
|
staticprotected |
Definition at line 48 of file MatcherProvider.java.
|
staticprotected |
Definition at line 47 of file MatcherProvider.java.
ArrayList<MatcherWrapper> cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherProvider.matcherWrappers |
Definition at line 46 of file MatcherProvider.java.