|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.sandia.cognition.util.AbstractCloneableSerializable
gov.sandia.cognition.data.convert.AbstractDataConverter<InputType,OutputType>
gov.sandia.cognition.text.convert.AbstractSingleTextualConverter<Document,Textual>
gov.sandia.cognition.text.convert.DocumentFieldConcatenator
public class DocumentFieldConcatenator
A document-text converter that concatenates multiple text fields from a document together for further processing.
Field Summary | |
---|---|
static String |
DEFAULT_FIELD_SEPARATOR
The default field separator is a newline. |
protected List<String> |
fieldNames
The list of fields to concatenate together from a document. |
protected String |
fieldSeparator
The field separator. |
Constructor Summary | |
---|---|
DocumentFieldConcatenator()
Creates a new DocumentFieldConcatenator with an empty list of
fields and a newline separator. |
|
DocumentFieldConcatenator(List<String> fieldNames,
String fieldSeparator)
Creates a new DocumentFieldConcatenator with the given field
names and field separator. |
Method Summary | |
---|---|
Textual |
evaluate(Document document)
Evaluates the function on the given input and returns the output. |
List<String> |
getFieldNames()
Gets the list of field names whose text are to be concatenated together. |
String |
getFieldSeparator()
Gets the string used as a separator between field text values. |
void |
setFieldNames(List<String> fieldNames)
Sets the list of field names whose text are to be concatenated together. |
void |
setFieldSeparator(String fieldSeparator)
Sets the string used as a separator between field text values. |
Methods inherited from class gov.sandia.cognition.text.convert.AbstractSingleTextualConverter |
---|
convert, convertAll |
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable |
---|
clone |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_FIELD_SEPARATOR
protected List<String> fieldNames
protected String fieldSeparator
Constructor Detail |
---|
public DocumentFieldConcatenator()
DocumentFieldConcatenator
with an empty list of
fields and a newline separator.
public DocumentFieldConcatenator(List<String> fieldNames, String fieldSeparator)
DocumentFieldConcatenator
with the given field
names and field separator.
fieldNames
- The names of the fields to include.fieldSeparator
- The field separator.Method Detail |
---|
public Textual evaluate(Document document)
Evaluator
document
- The input to evaluate.
public List<String> getFieldNames()
public void setFieldNames(List<String> fieldNames)
fieldNames
- The list of field names.public String getFieldSeparator()
public void setFieldSeparator(String fieldSeparator)
fieldSeparator
- The separator between fields used in the result.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |