Package eu.clarin.weblicht.wlfxb.tc.xb
Class ConstituentParsingLayerStored
- java.lang.Object
-
- eu.clarin.weblicht.wlfxb.tc.xb.TextCorpusLayerStoredAbstract
-
- eu.clarin.weblicht.wlfxb.tc.xb.ConstituentParsingLayerStored
-
- All Implemented Interfaces:
ConstituentParsingLayer
,TextCorpusLayer
public class ConstituentParsingLayerStored extends TextCorpusLayerStoredAbstract implements ConstituentParsingLayer
- Author:
- Yana Panchenko
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConstituentParsingLayerStored()
protected
ConstituentParsingLayerStored(TextCorpusLayersConnector connector)
protected
ConstituentParsingLayerStored(String tagset)
-
Method Summary
Modifier and Type Method Description Constituent
addChild(Constituent parent, Constituent child)
Adds constituent child to a parent constituent.ConstituentParse
addParse(Constituent root)
Creates sentence parse with the given constituent root.Constituent
addSecondaryEdgeChild(Constituent parent, Constituent child, String edgeLabel)
Adds secondary edge child to a constituent.Constituent
createConstituent(String category)
Creates non-terminal constituent with the given category, children should be added laterConstituent
createConstituent(String category, String edge)
Constituent
createConstituent(String category, String edge, String id)
Constituent
createConstituent(String category, String edge, List<Constituent> children)
Constituent
createConstituent(String category, String edge, List<Constituent> children, String id)
Constituent
createConstituent(String category, List<Constituent> children)
Creates non-terminal constituent with the given category and constituent children.Constituent
createConstituent(String category, List<Constituent> children, String id)
Constituent
createTerminalConstituent(String category, Token token)
Creates terminal constituent with the given category and tokenConstituent
createTerminalConstituent(String category, String edge, Token token)
Constituent
createTerminalConstituent(String category, String edge, Token token, String id)
Constituent
createTerminalConstituent(String category, String edge, List<Token> tokens)
Constituent
createTerminalConstituent(String category, String edge, List<Token> tokens, String id)
Constituent
createTerminalConstituent(String category, List<Token> tokens)
Creates terminal constituent with the given category and tokensConstituent
createTerminalConstituent(String category, List<Token> tokens, String id)
Constituent
getConstituent(ConstituentReference cref)
Gets the Constituent reference by this ConstituentReference objectConstituentParse
getParse(int index)
Constituent
getParseRoot(int index)
String
getTagset()
Token[]
getTokens(Constituent constituent)
Token[]
getTokens(ConstituentParse parse)
boolean
isEmpty()
protected void
setLayersConnector(TextCorpusLayersConnector connector)
Should not be used directly by users.int
size()
String
toString()
-
-
-
Field Detail
-
XML_NAME
public static final String XML_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConstituentParsingLayerStored
protected ConstituentParsingLayerStored()
-
ConstituentParsingLayerStored
protected ConstituentParsingLayerStored(String tagset)
-
ConstituentParsingLayerStored
protected ConstituentParsingLayerStored(TextCorpusLayersConnector connector)
-
-
Method Detail
-
setLayersConnector
protected void setLayersConnector(TextCorpusLayersConnector connector)
Description copied from class:TextCorpusLayerStoredAbstract
Should not be used directly by users. Should be extended by all implementations of TextCorpusLayers, as they might depend on other layers and therefore be able to get referenced/referencing information.- Specified by:
setLayersConnector
in classTextCorpusLayerStoredAbstract
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceTextCorpusLayer
-
size
public int size()
- Specified by:
size
in interfaceTextCorpusLayer
-
getTagset
public String getTagset()
- Specified by:
getTagset
in interfaceConstituentParsingLayer
-
getParse
public ConstituentParse getParse(int index)
- Specified by:
getParse
in interfaceConstituentParsingLayer
-
getParseRoot
public Constituent getParseRoot(int index)
- Specified by:
getParseRoot
in interfaceConstituentParsingLayer
-
getTokens
public Token[] getTokens(ConstituentParse parse)
- Specified by:
getTokens
in interfaceConstituentParsingLayer
-
getTokens
public Token[] getTokens(Constituent constituent)
- Specified by:
getTokens
in interfaceConstituentParsingLayer
-
getConstituent
public Constituent getConstituent(ConstituentReference cref)
Description copied from interface:ConstituentParsingLayer
Gets the Constituent reference by this ConstituentReference object- Specified by:
getConstituent
in interfaceConstituentParsingLayer
-
createConstituent
public Constituent createConstituent(String category, List<Constituent> children)
Description copied from interface:ConstituentParsingLayer
Creates non-terminal constituent with the given category and constituent children. Children should have been created by the same ConstituentParsingLayer object before- Specified by:
createConstituent
in interfaceConstituentParsingLayer
-
createConstituent
public Constituent createConstituent(String category, String edge, List<Constituent> children)
- Specified by:
createConstituent
in interfaceConstituentParsingLayer
-
createConstituent
public Constituent createConstituent(String category, List<Constituent> children, String id)
- Specified by:
createConstituent
in interfaceConstituentParsingLayer
-
createConstituent
public Constituent createConstituent(String category)
Description copied from interface:ConstituentParsingLayer
Creates non-terminal constituent with the given category, children should be added later- Specified by:
createConstituent
in interfaceConstituentParsingLayer
-
createConstituent
public Constituent createConstituent(String category, String edge)
- Specified by:
createConstituent
in interfaceConstituentParsingLayer
-
createConstituent
public Constituent createConstituent(String category, String edge, String id)
- Specified by:
createConstituent
in interfaceConstituentParsingLayer
-
createConstituent
public Constituent createConstituent(String category, String edge, List<Constituent> children, String id)
- Specified by:
createConstituent
in interfaceConstituentParsingLayer
-
addChild
public Constituent addChild(Constituent parent, Constituent child)
Description copied from interface:ConstituentParsingLayer
Adds constituent child to a parent constituent. Both child and parent constituent should have been created by the same ConstituentParsingLayer object before- Specified by:
addChild
in interfaceConstituentParsingLayer
-
addSecondaryEdgeChild
public Constituent addSecondaryEdgeChild(Constituent parent, Constituent child, String edgeLabel)
Description copied from interface:ConstituentParsingLayer
Adds secondary edge child to a constituent. Both child and parent constituent should have been created by the same ConstituentParsingLayer object before- Specified by:
addSecondaryEdgeChild
in interfaceConstituentParsingLayer
-
createTerminalConstituent
public Constituent createTerminalConstituent(String category, List<Token> tokens)
Description copied from interface:ConstituentParsingLayer
Creates terminal constituent with the given category and tokens- Specified by:
createTerminalConstituent
in interfaceConstituentParsingLayer
-
createTerminalConstituent
public Constituent createTerminalConstituent(String category, String edge, List<Token> tokens)
- Specified by:
createTerminalConstituent
in interfaceConstituentParsingLayer
-
createTerminalConstituent
public Constituent createTerminalConstituent(String category, List<Token> tokens, String id)
- Specified by:
createTerminalConstituent
in interfaceConstituentParsingLayer
-
createTerminalConstituent
public Constituent createTerminalConstituent(String category, Token token)
Description copied from interface:ConstituentParsingLayer
Creates terminal constituent with the given category and token- Specified by:
createTerminalConstituent
in interfaceConstituentParsingLayer
-
createTerminalConstituent
public Constituent createTerminalConstituent(String category, String edge, Token token)
- Specified by:
createTerminalConstituent
in interfaceConstituentParsingLayer
-
createTerminalConstituent
public Constituent createTerminalConstituent(String category, String edge, Token token, String id)
- Specified by:
createTerminalConstituent
in interfaceConstituentParsingLayer
-
createTerminalConstituent
public Constituent createTerminalConstituent(String category, String edge, List<Token> tokens, String id)
- Specified by:
createTerminalConstituent
in interfaceConstituentParsingLayer
-
addParse
public ConstituentParse addParse(Constituent root)
Description copied from interface:ConstituentParsingLayer
Creates sentence parse with the given constituent root. Root should have been created by the same ConstituentParsingLayer object before- Specified by:
addParse
in interfaceConstituentParsingLayer
-
-