Methods for translating output from SEC API to the Suggestion objects.
More...
|
Alternative | processNestedAlternative (Element atEl, RequestInfo requestInfo, ArrayList< AnnotType > newTypes) |
|
ArrayList< Alternative > | processAlternatives (RequestInfo requestInfo, Element alternatvesEl, ArrayList< AnnotType > newTypes, AlternativeFragment altFragment) |
|
ArrayList< Alternative > | makeNewAlternative (RequestInfo requestInfo, HashMap< Integer, ArrayList< SuggestionFragment >> sugToLinFragments, HashMap< Integer, TranslateAlternativeHolder > alternativesHolders) |
|
void | findAlternativeSuggestions (HashMap< Integer, TranslateAlternativeHolder > alternatives, ArrayList< Suggestion > validSuggestions, HashMap< Integer, ArrayList< SuggestionFragment >> sugToLinFragments) |
|
boolean | isAlternativeInSuggestionList (List< Suggestion > suggestions, Alternative alt, HashMap< Integer, ArrayList< SuggestionFragment >> sugToLinFragments) |
|
AlternativeFragment | fixAlternativeFragment (RequestInfo requestInfo, AlternativeFragment frg) |
|
Suggestion | processNestedSugg (Element attEl, RequestInfo requestInfo, ArrayList< AnnotType > newTypes) |
|
ArrayList | convertLinFragments (RequestInfo requestInfo, ArrayList result, ArrayList allLinFragments, boolean useAlternatives) |
|
SecSuggestion | createSugFromElement (RequestInfo requestInfo, Element el, ArrayList< AnnotType > newTypes, boolean useAlternatives) |
|
SecAttribute | processAttributeEl (RequestInfo requestInfo, Element atEl, ArrayList sugAList, HashMap< String, Integer >atPriorities, HashMap< String, Integer >usedPriorities, int pGen, ArrayList< AnnotTypeAttr > atList, boolean useAlternatives, SecSuggestion sug, ArrayList< AnnotType > newTypes) |
|
Methods for translating output from SEC API to the Suggestion objects.
Class provides methods for translating of suggestions from SEC API to the objects of class Suggestion.
- Author
- idytrych
Definition at line 53 of file SECAPISuggestionTranslator.java.
cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.SECAPISuggestionTranslator |
( |
UserGroup |
userGroup | ) |
|
ArrayList cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.convertLinFragments |
( |
RequestInfo |
requestInfo, |
|
|
ArrayList |
result, |
|
|
ArrayList |
allLinFragments, |
|
|
boolean |
useAlternatives |
|
) |
| |
|
private |
Converts linearized fragments to common fragments
- Parameters
-
requestInfo | Informations about client request |
result | List with suggestions or alternatives to which fragments belongs |
allLinFragments | List of all linearized fragments to convert |
useAlternatives | True for work with alternatives, false otherwise |
- Returns
- Returns list with suggestions or alternatives to which fragments belongs with converted fragments
Definition at line 855 of file SECAPISuggestionTranslator.java.
SecSuggestion cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.createSugFromElement |
( |
RequestInfo |
requestInfo, |
|
|
Element |
el, |
|
|
ArrayList< AnnotType > |
newTypes, |
|
|
boolean |
useAlternatives |
|
) |
| |
|
private |
Creates suggestion object from XML element with suggestion
- Parameters
-
requestInfo | Informations about client request |
el | XML element with suggestion |
newTypes | Array for adding new types of annotations |
useAlternatives | True for work with alternatives, false otherwise |
- Returns
- Object with suggestion
Definition at line 963 of file SECAPISuggestionTranslator.java.
void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.findAlternativeSuggestions |
( |
HashMap< Integer, TranslateAlternativeHolder > |
alternatives, |
|
|
ArrayList< Suggestion > |
validSuggestions, |
|
|
HashMap< Integer, ArrayList< SuggestionFragment >> |
sugToLinFragments |
|
) |
| |
|
private |
Finds suggestions for which were alternatives sent and adds alternatives from DB.
- Parameters
-
alternatives | Alternatives from SEC API |
validSuggestions | Alternatives is assign to one of these suggestions |
sugToLinFragments | Linearized fragments of given valid suggestions |
Definition at line 450 of file SECAPISuggestionTranslator.java.
AnnotType cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.findType |
( |
RequestInfo |
requestInfo, |
|
|
ArrayList< AnnotType > |
newTypes, |
|
|
String |
typePath |
|
) |
| |
Searches for a type specified by the typePath and returns the type if found
- Parameters
-
requestInfo | Information about a client request |
newTypes | A list containing newly created types |
typePath | A path for the type identification |
- Returns
- Type data if found, empty data object otherwise
Definition at line 1776 of file SECAPISuggestionTranslator.java.
Converts linearized fragment to normal fragment
- Parameters
-
requestInfo | Informations about client request |
frg | Linearized fragment to convert |
- Returns
- Returns converted fragment
Definition at line 565 of file SECAPISuggestionTranslator.java.
static String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.getGeoPointNodeValue |
( |
Node |
node | ) |
|
|
staticprivate |
static HashMap<String, Integer> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.getPriorities |
( |
String |
name | ) |
|
|
staticprivate |
Gets map with priorities of attributes of given type
- Parameters
-
- Returns
- Returns map with priorities of attributes of given type
Definition at line 1200 of file SECAPISuggestionTranslator.java.
boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.isAlternativeInSuggestionList |
( |
List< Suggestion > |
suggestions, |
|
|
Alternative |
alt, |
|
|
HashMap< Integer, ArrayList< SuggestionFragment >> |
sugToLinFragments |
|
) |
| |
|
private |
Check, if alternative is in suggestion list.
- Parameters
-
suggestions | Suggestion list. |
alt | Alternative. |
sugToLinFragments | HashMap with linearized fragments |
- Returns
- Check, if alternative is in suggestion list.
Definition at line 547 of file SECAPISuggestionTranslator.java.
static void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.linearizeSuggestions |
( |
HashMap< Integer, ArrayList< SuggestionFragment >> |
linFragmentsMap, |
|
|
Document |
doc, |
|
|
ArrayList< Suggestion > |
suggestions |
|
) |
| |
|
static |
Linearize fragments of given suggestions and return fragments as hash map where key is id of suggestion.
- Parameters
-
linFragmentsMap | hash map where the result will be stored |
doc | annotated document |
suggestions | suggestion which fragments will be linearize |
Definition at line 505 of file SECAPISuggestionTranslator.java.
Method creates new alternatives from SEC API message for given suggestions.
- Parameters
-
requestInfo | Informations about client request |
sugToLinFragments | Linearized fragments of given suggestions |
alternativesHolders | new alternatives and alternatives from DB |
- Returns
- array of new alternatives
Definition at line 316 of file SECAPISuggestionTranslator.java.
static Date cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.parseDate |
( |
String |
sDate | ) |
|
|
staticprivate |
Parses date from ISO format from dates.py (which is part of SEC API NER)
- Parameters
-
- Returns
- Returns parsed date
Definition at line 1732 of file SECAPISuggestionTranslator.java.
static Document cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.parseXml |
( |
String |
XMLString | ) |
|
|
staticprivate |
Parses XML from the SEC API
- Parameters
-
XMLString | String with XML with messages from client |
- Returns
- Parsed XML in w3c.dom.Document
Definition at line 1693 of file SECAPISuggestionTranslator.java.
Processes element with entity additional attributes in entity in attribute of alternative
- Parameters
-
el | Element with entity additional attributes |
refAltAtt | Attribute of alternative of type entity to which attributes belongs |
- Returns
- List of entity additional attributes
Definition at line 1612 of file SECAPISuggestionTranslator.java.
static AlternativeFragment cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.processAlternativeFragment |
( |
Element |
fragmentEl | ) |
|
|
staticprivate |
Method converts the raw format of alternatives fragments from SEC Api to array of objects.
- Parameters
-
fragmentEl | Element with alternatives fragments from SEC Api in raw format |
- Returns
- array of alternatives fragments from SEC Api
Definition at line 284 of file SECAPISuggestionTranslator.java.
Method converts the raw format of alternatives from SEC Api to array of objects.
- Parameters
-
requestInfo | Informations about client request |
alternatvesEl | Element with alternatives from SEC Api in raw format |
newTypes | Array for adding new types of annotations |
altFragment | Fragment that is assigned to all created alternatives |
- Returns
- array of alternatives from SEC Api
Definition at line 243 of file SECAPISuggestionTranslator.java.
SecAttribute cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.processAttributeEl |
( |
RequestInfo |
requestInfo, |
|
|
Element |
atEl, |
|
|
ArrayList |
sugAList, |
|
|
HashMap< String, Integer > |
atPriorities, |
|
|
HashMap< String, Integer > |
usedPriorities, |
|
|
int |
pGen, |
|
|
ArrayList< AnnotTypeAttr > |
atList, |
|
|
boolean |
useAlternatives, |
|
|
SecSuggestion |
sug, |
|
|
ArrayList< AnnotType > |
newTypes |
|
) |
| |
|
private |
Creates suggestion object from XML element with attribute
- Parameters
-
requestInfo | Informations about client request |
sugAList | List of already processed attributes (for searching of duplicities) |
atEl | XML element with attribute |
atPriorities | Array with priorities of attributes |
usedPriorities | Array with priorities which was already used |
pGen | Counter for generating of missing priorities |
atList | List of attributes for creation of type of annotation |
useAlternatives | True for work with alternatives, false otherwise |
sug | Suggestion to which this attribute will be added |
newTypes | New annotation types |
- Returns
- Object with attribute
Definition at line 1230 of file SECAPISuggestionTranslator.java.
static String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.processGeoPoint |
( |
Element |
el, |
|
|
boolean |
latitude |
|
) |
| |
|
staticprivate |
Gets GeoPoint value from element
- Parameters
-
el | GeoPoint element |
latitude | Flag for getting either latitude or longitude |
- Returns
- If flag parameter is set to true, returns latitude value, longitude otherwise
Definition at line 1641 of file SECAPISuggestionTranslator.java.
Alternative cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.processNestedAlternative |
( |
Element |
atEl, |
|
|
RequestInfo |
requestInfo, |
|
|
ArrayList< AnnotType > |
newTypes |
|
) |
| |
|
private |
Method that process nested alternatives
Note: It's called recursively
- Parameters
-
atEl | Attribute element |
requestInfo | RequestInfo |
newTypes | New Annotations types |
- Returns
- Nested alternative
Definition at line 176 of file SECAPISuggestionTranslator.java.
Suggestion cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.processNestedSugg |
( |
Element |
attEl, |
|
|
RequestInfo |
requestInfo, |
|
|
ArrayList< AnnotType > |
newTypes |
|
) |
| |
|
private |
Method that process nested suggestions
Note: It's called recursively
- Parameters
-
attEl | Attribute element |
requestInfo | RequestInfo |
newTypes | New Annotations types |
- Returns
- Nested suggestion
Definition at line 782 of file SECAPISuggestionTranslator.java.
Processes element with entity additional attributes in entity in attribute of suggestion
- Parameters
-
el | Element with entity additional attributes |
refEntity | Attribute of suggestion of type entity to which attributes belongs |
- Returns
- List of entity additional attributes
Definition at line 1582 of file SECAPISuggestionTranslator.java.
ArrayList<Alternative> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.translateAlternativeFromSecApi |
( |
RequestInfo |
requestInfo, |
|
|
String |
SECAPIResults, |
|
|
ArrayList< AnnotType > |
newTypes, |
|
|
ArrayList< Suggestion > |
validSuggestions |
|
) |
| |
Gets alternatives from SEC API and translates them to the Suugestion objects.
- Parameters
-
requestInfo | Informations about client request |
SECAPIResults | Results from SEC API in String |
newTypes | Array for adding new types of annotations |
validSuggestions | Alternatives is assign to one of theese suggestions |
- Returns
- Resutns alternatives for the document
Definition at line 100 of file SECAPISuggestionTranslator.java.
ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.translateSugFromSecApi |
( |
RequestInfo |
requestInfo, |
|
|
String |
SECAPIResults, |
|
|
ArrayList< AnnotType > |
newTypes |
|
) |
| |
Gets suggestions from SEC API and translates them to the Suugestion objects.
- Parameters
-
requestInfo | Informations about client request |
SECAPIResults | Results from SEC API in String |
newTypes | Array for adding new types of annotations |
- Returns
- Resutns suggestions for the document
Definition at line 613 of file SECAPISuggestionTranslator.java.
String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.baseTypeUri |
|
package |
final int cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.DEFAULT_SUGGESTION_CONFIDENCE = 50 |
|
static |
UserGroup cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.defaultUserGroup |
|
package |
final String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.LATITUDE_NAME = "latitude" |
|
static |
final String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.LONGITUDE_NAME = "longitude" |
|
static |
final String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.MODULE_NAME = "SECAPISuggestionTranslator" |
|
static |
final String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.STRING_ATT_VALUES_SEPARATOR = ", " |
|
static |
final String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.TEXT_ATT_VALUES_SEPARATOR = " \n" |
|
static |
HashMap<String,AnnotType> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.typesBuffer |
|
package |
UserGroup cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPISuggestionTranslator.userGroup |
|
package |
The documentation for this class was generated from the following file: