|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--Amalgamation
An Amalgamation is formed by concatenating all the TEXT_NODEs that are
descendants of a node for which spec.isContainer()
or spec.isSubcontainer() returns true. An Amalgamation
of a container, however, does not contain text in subcontainers of that
container. An amalgamation contains text in one language only.
| Field Summary | |
org.w3c.dom.Node |
aNode
|
java.lang.String |
lang
|
boolean |
markGrapheme
|
boolean |
notFullyPopulated
|
int[] |
offsets
|
DocSpec |
spec
|
java.lang.String |
text
|
| Constructor Summary | |
Amalgamation(org.w3c.dom.Node node,
DocSpec spec,
java.lang.String lang,
boolean forceRecursive)
|
|
| Method Summary | |
java.lang.Object |
clone()
Creates a clone (deep copy) of this Amalgamation. |
void |
filterText()
Translates text using a display filter. |
java.lang.String |
getLanguage()
Returns the language code for the Amalgamation. |
org.w3c.dom.Node |
getNode()
Returns the node on which this is an Amalgamation. |
java.lang.String |
getNodeText(org.w3c.dom.Node node,
boolean recursive)
Returns the contents of all TEXT_NODEs in the subtree under node. |
int[] |
getOffsetTable()
Returns the offset table that maps offsets in a source string onto offsets in the text of this Amalgamation. |
java.lang.String |
getOriginalText()
Returns the original (unnormalized, unfiltered) text for this amalgamation. |
Span |
getSpan(int start,
int end)
Returns a span on a source string corresponding to the range start..end in text. |
int |
length()
Returns the length of text. |
void |
normalizeOrthography()
Convenience method for doing orthographic normalization with no rule suffix. |
void |
normalizeOrthography(java.lang.String suffix)
Rewrites text using a set of orthographic normalization
rules. |
void |
setOffset(int tOfs,
int sOfs)
Adds a reference that maps an offset sOfs in a source string
onto an offset tOfs in the text of this
Amalgamation. |
java.lang.String |
toString()
Returns the text of this Amalgamation. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public java.lang.String text
public java.lang.String lang
public int[] offsets
public boolean notFullyPopulated
public boolean markGrapheme
public org.w3c.dom.Node aNode
public DocSpec spec
| Constructor Detail |
public Amalgamation(org.w3c.dom.Node node,
DocSpec spec,
java.lang.String lang,
boolean forceRecursive)
| Method Detail |
public java.lang.String getNodeText(org.w3c.dom.Node node,
boolean recursive)
node.node - root of subtreerecursive - work recursively on subtree below given node
public void setOffset(int tOfs,
int sOfs)
sOfs in a source string
onto an offset tOfs in the text of this
Amalgamation.tOfs - offset in textsOfs - offset in source stringpublic int[] getOffsetTable()
text of this Amalgamation.public java.lang.String toString()
text of this Amalgamation.toString in class java.lang.Objecttext
public Span getSpan(int start,
int end)
start..end in text.start - start offset in textend - end offset in textpublic int length()
text.text.public void normalizeOrthography(java.lang.String suffix)
text using a set of orthographic normalization
rules.
WARNING: Do not call normalizeOrthography() and then
set offsets with setOffset(). Doing so will
likely trash the offset table!
suffix - orthographic rule suffixpublic void normalizeOrthography()
public void filterText()
text using a display filter.public java.lang.String getOriginalText()
public java.lang.String getLanguage()
public org.w3c.dom.Node getNode()
public java.lang.Object clone()
clone in class java.lang.Object
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||