Class TableExtractor
java.lang.Object
org.getalp.dbnary.morphology.HtmlTableHandler
org.getalp.dbnary.morphology.TableExtractor
- Direct Known Subclasses:
GermanTableExtractor, SwedishTableExtractor
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddToContext(ArrayMatrix<org.jsoup.nodes.Element> columnHeaders, int i, int j, List<String> res) protected Collection<? extends String> decodeH2Context(String text) getInflectedForms(org.jsoup.nodes.Element cell) Extract wordforms from table cell
Splits cell content by <br\> or comma and removes HTML formattingprotected abstract List<? extends InflectionData> getInflectionDataFromCellContext(List<String> context) returns the inflection data that correspond to current celle contextgetRowAndColumnContext(int nrow, int ncol, ArrayMatrix<org.jsoup.nodes.Element> columnHeaders) protected voidhandleNestedTables(org.jsoup.nodes.Element cell, List<String> context, InflectedFormSet forms) protected voidhandleSimpleCell(org.jsoup.nodes.Element cell, List<String> context, InflectedFormSet forms) protected booleanisHeaderCell(org.jsoup.nodes.Element cell) protected booleanisNormalCell(org.jsoup.nodes.Element cell) protected InflectedFormSetparseTable(org.jsoup.nodes.Element table, List<String> globalContext) protected booleanshouldIgnoreCurrentH2(org.jsoup.nodes.Element elt) returns true if the current H2 element should be ignore while extracting morphological tablesprotected booleanshouldProcessCell(org.jsoup.nodes.Element cell) Methods inherited from class HtmlTableHandler
explodeTable, getBackgroundColor
-
Field Details
-
alreadyParsedTables
-
currentEntry
-
-
Constructor Details
-
TableExtractor
public TableExtractor()
-
-
Method Details
-
getInflectionDataFromCellContext
protected abstract List<? extends InflectionData> getInflectionDataFromCellContext(List<String> context) returns the inflection data that correspond to current celle 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 InflexionData corresponding to the context
-
shouldIgnoreCurrentH2
protected boolean shouldIgnoreCurrentH2(org.jsoup.nodes.Element elt) returns true if the current H2 element should be ignore while extracting morphological tables- Parameters:
elt- the H2 Header Element- Returns:
- true iff the section should be ignored
-
parseHTML
-
decodeH2Context
-
parseTable
-
shouldProcessCell
protected boolean shouldProcessCell(org.jsoup.nodes.Element cell) -
handleSimpleCell
protected void handleSimpleCell(org.jsoup.nodes.Element cell, List<String> context, InflectedFormSet forms) -
handleNestedTables
protected void handleNestedTables(org.jsoup.nodes.Element cell, List<String> context, InflectedFormSet forms) -
isNormalCell
protected boolean isNormalCell(org.jsoup.nodes.Element cell) -
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 void addToContext(ArrayMatrix<org.jsoup.nodes.Element> columnHeaders, int i, int j, List<String> res) -
getInflectedForms
-