Class Index | File Index

Classes


Class de.aitools.js.Document

Simple representation for a real-world document
Defined in: Document.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
de.aitools.js.Document(id, features, plaintext)
Document is a simple representation for a real-world document.
Method Summary
Method Attributes Method Name and Description
 
addFeature(feature)
Add a feature to this document.
 
getFeatureAttributes(featureName, attributeKey)
Returns the value of the attribute from the feature with the given name and key.
 
Returns all features.
 
Returns the document id.
 
Returns the plaintext of the document.
 
hasFeatures(featureName)
Returns true if this document contains at least one feature with name "featureName".
 
setFeatures(features)
Set the features of this document with the given features.
 
setId(id)
Set the id of this document.
 
setPlaintext(plaintext)
Set the plaintext of this document.
 
Returns the document formattet as string.
Class Detail
de.aitools.js.Document(id, features, plaintext)
Document is a simple representation for a real-world document. It may have one plaintext, one unique identifier and an arbitrary number of features representing properties of the document, e.g. the URI or topic. The constructor parameters are optional, all may be set later by using the proper methods.
Author: Christof Braeutigam christof.braeutigam@uni-weimar.de.
Parameters:
{String} id
Identifier for the document.
{Array} features
An arbitrary number of features given as array.
{String} plaintext
This documents plaintext.
Deprecated:
Needs refactoring to match concept of current Java aitools Document version
Method Detail
{Number} addFeature(feature)
Add a feature to this document.
Parameters:
{de.aitools.js.Feature} feature
The feature to add.
Returns:
{Number} Number of features with the same name.

{Object} getFeatureAttributes(featureName, attributeKey)
Returns the value of the attribute from the feature with the given name and key.
Parameters:
{String} featureName
Name of the feature.
{String} attributeKey
Key of the requested attribute.
Returns:
{Object} Value of the requested attribute.

{Array} getFeatures()
Returns all features.
Returns:
{Array} Map containing name -> [Feature] mappings.

{String} getId()
Returns the document id.
Returns:
{String} Id of the document.

{String} getPlaintext()
Returns the plaintext of the document.
Returns:
{String} Plaintext of the document.

{Boolean} hasFeatures(featureName)
Returns true if this document contains at least one feature with name "featureName".
Parameters:
{String} featureName
Name of the feature to check.
Returns:
{Boolean} True if this document contains at least one feature named "featureName", otherwise false.

setFeatures(features)
Set the features of this document with the given features.
Parameters:
{Array} features
Features to set.

setId(id)
Set the id of this document.
Parameters:
{String} id
Id of the document.

setPlaintext(plaintext)
Set the plaintext of this document.
Parameters:
{String} plaintext
Plaintext of the document.

{String} toString()
Returns the document formattet as string.
Returns:
{String} The document formattet as string.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed May 30 2012 16:21:04 GMT+0200 (CEST)