Class RefactoredTableExtractor
java.lang.Object
org.getalp.dbnary.morphology.RefactoredTableExtractor
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
CatalanConjugationTableExtractor, FrenchAccordsTableExtractor, ImpersonalMoodTableExtractor, StandardMoodTableExtractor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ArrayMatrix<org.jsoup.nodes.Element> protected Stringprotected final Stringprotected ArrayMatrix<Set<LexicalForm>> -
Constructor Summary
ConstructorsConstructorDescriptionRefactoredTableExtractor(String entryName, String language, List<String> context) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddToContext(ArrayMatrix<org.jsoup.nodes.Element> columnHeaders, int i, int j, List<String> res) protected Objectclone()protected booleanelementIsAValidForm(org.jsoup.nodes.Element anchor) protected org.jsoup.nodes.ElementgetCell(int i, int j) protected Set<LexicalForm> getInflectedForms(org.jsoup.nodes.Element cell, InflectionScheme infl) Extract wordforms from table cell
Splits cell content by <br\> or comma and removes HTML formattingprotected abstract InflectionSchemegetInflectionSchemeFromContext(List<String> context) returns the inflection that correspond to current cell contextprotected Set<LexicalForm> getLexicalFormsFromCell(int i, int j, org.jsoup.nodes.Element cell, List<String> context) returns the set of lexical forms that correspond to current cell and contextprotected Set<LexicalForm> getResult(int i, int j) getRowAndColumnContext(int nrow, int ncol, ArrayMatrix<org.jsoup.nodes.Element> columnHeaders) protected Set<LexicalForm> handleNestedTables(int i, int j, org.jsoup.nodes.Element cell, List<String> context) protected Set<LexicalForm> handleSimpleCell(int i, int j, org.jsoup.nodes.Element cell, List<String> context) protected booleanisHeaderCell(org.jsoup.nodes.Element cell) parseTable(org.jsoup.nodes.Element tableElement) protected booleanshouldProcessCell(org.jsoup.nodes.Element cell) true if the cell should be processed by the extractor.protected StringstandardizeValue(String value)
-
Field Details
-
language
-
entryName
-
globalContext
-
cells
-
results
-
-
Constructor Details
-
RefactoredTableExtractor
-
-
Method Details
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
getCell
protected org.jsoup.nodes.Element getCell(int i, int j) -
getResult
-
parseTable
-
shouldProcessCell
protected boolean shouldProcessCell(org.jsoup.nodes.Element cell) true if the cell should be processed by the extractor. This is called for a normal cell and not for a header cell, it allows specific subclasses to further filter out cells based on their content.- Parameters:
cell- the td element to be examined- Returns:
- true if the cell should be processed
-
handleSimpleCell
protected Set<LexicalForm> handleSimpleCell(int i, int j, org.jsoup.nodes.Element cell, List<String> context) -
handleNestedTables
protected Set<LexicalForm> handleNestedTables(int i, int j, org.jsoup.nodes.Element cell, List<String> context) -
isHeaderCell
protected boolean isHeaderCell(org.jsoup.nodes.Element cell) -
getRowAndColumnContext
protected List<String> getRowAndColumnContext(int nrow, int ncol, ArrayMatrix<org.jsoup.nodes.Element> columnHeaders) -
addToContext
protected boolean addToContext(ArrayMatrix<org.jsoup.nodes.Element> columnHeaders, int i, int j, List<String> res) -
getLexicalFormsFromCell
protected Set<LexicalForm> getLexicalFormsFromCell(int i, int j, org.jsoup.nodes.Element cell, List<String> context) returns the set of lexical forms that correspond to current cell and contextThe context is a list of String that corresponds to all column and row headers + section headers in which the cell appears.
- Parameters:
i- the line number of the cell in the tablej- the column number of the cell in the tablecontext- a list of Strings that represent the celle context- Returns:
- The set of lexical forms corresponding to the context
-
getInflectionSchemeFromContext
returns the inflection that correspond to current cell contextThe cell context is a list of String that corresponds to all column and row headers + section headers in which the cell appears.
- Parameters:
context- a list of Strings that represent the celle context- Returns:
- The set of lexical forms corresponding to the context
-
getInflectedForms
Extract wordforms from table cell
Splits cell content by <br\> or comma and removes HTML formatting- Parameters:
cell- the current cell in the inflection tableinfl- the inflection scheme corresponding to the current cell- Returns:
- Set of wordforms (Strings) from this cell
-
elementIsAValidForm
protected boolean elementIsAValidForm(org.jsoup.nodes.Element anchor) -
standardizeValue
-