Linkable.Utility
Class Context
java.lang.Object
|
+--Linkable.Utility.Context
- public class Context
- extends java.lang.Object
This class encapsulates a single context. A context
contains 1 or more references. One separate context object
is created for each one of these references.
Field Summary |
private java.lang.String |
anchor
|
private java.lang.String |
context
|
private static boolean |
DEBUG
|
private static uk.ac.soton.harvester.EntityDecode |
ed
|
private static java.lang.String |
ME
|
private int |
myRef
|
private java.lang.String |
normalizedRef
|
private int |
ordinal
|
Constructor Summary |
Context(java.lang.String a,
java.lang.String b,
java.lang.String c,
int d,
int e)
constructor - |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
ME
private static final java.lang.String ME
DEBUG
private static final boolean DEBUG
ed
private static uk.ac.soton.harvester.EntityDecode ed
anchor
private java.lang.String anchor
normalizedRef
private java.lang.String normalizedRef
context
private java.lang.String context
myRef
private int myRef
ordinal
private int ordinal
Context
public Context(java.lang.String a,
java.lang.String b,
java.lang.String c,
int d,
int e)
- constructor -
- Parameters:
-
- String which is an anchor in this context-
- String which is the normalized reference-
- String which is the sentence containing this anchor-
- integer which is the 0-base index of the reference-
- integer which is the 1-base position of this context in
the text.
Note: the caller guarantees that the context string is trimmed
and free of newlines. Reconstructed surrogates have contexts
that are already cleaned. Analysis on the fly has to clean it
before calling this constructor.
getAnchor
public java.lang.String getAnchor()
getNormalizedRef
public java.lang.String getNormalizedRef()
getContext
public java.lang.String getContext()
getRefIndex
public int getRefIndex()
getOrd
public int getOrd()
toXML
public java.lang.String toXML(java.lang.String pad)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
reconstruct
public static Context[] reconstruct(int r,
org.w3c.dom.Element context_list)
- rebuilds a Context[] array from XML for a tree.
- Parameters:
0-based
- index of the element containing this
context-list.The
- root node of the tree