Package org.apache.nlpcraft.model
Interface NCCustomElement
-
- All Superinterfaces:
NCMetadata
public interface NCCustomElement extends NCMetadata
Detected model element returning from custom parser. Note that model elements returned fromNCCustomParser.parse(NCRequest, NCModelView, List, List)
method must be defined in the model.- See Also:
NCModelView.getParsers()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getElementId()
Gets ID of the detected model element.Map<String,Object>
getMetadata()
Optional metadata that will be added to the resultingNCToken
object and that would be accessible viaNCMetadata.getMetadata()
.List<NCCustomWord>
getWords()
Gets a list of NLP custom words that matched detected model element.-
Methods inherited from interface org.apache.nlpcraft.model.NCMetadata
meta, meta, metaOpt, metax
-
-
-
-
Method Detail
-
getElementId
String getElementId()
Gets ID of the detected model element. Note that it must correspond to one of the elements defined in the model. In other words, the parser doesn't define a new model element but rather references the element that's already defined in the model.- Returns:
- ID of the detected model element.
- See Also:
NCElement.getId()
,NCModelView.getElements()
-
getWords
List<NCCustomWord> getWords()
Gets a list of NLP custom words that matched detected model element. These must be the same custom words that were originally passed toNCCustomParser.parse(NCRequest, NCModelView, List, List)
method.- Returns:
- List of NLP custom words that comprise detected custom model element.
-
getMetadata
Map<String,Object> getMetadata()
Optional metadata that will be added to the resultingNCToken
object and that would be accessible viaNCMetadata.getMetadata()
.- Specified by:
getMetadata
in interfaceNCMetadata
- Returns:
- Optional metadata for the detected custom model element.
- See Also:
NCMetadata.meta(String)
,NCMetadata.metaOpt(String)
,NCMetadata.meta(String, Object)
-
-