Class Orthography
java.lang.Object
ca.phon.orthography.Orthography
- All Implemented Interfaces:
IExtendable,Visitable<OrthographyElement>,Iterable<OrthographyElement>
public final class Orthography
extends Object
implements Iterable<OrthographyElement>, Visitable<OrthographyElement>, IExtendable
Container for orthographic transcriptions. This class is immutable after being created.
To append/modify the data in the Orthography, use the
OrthographyBuilder class to create
a modified Orthography instance.
The parseOrthography method accepts Strings in the
CHAT Transcription Format-
Constructor Summary
ConstructorsConstructorDescriptionOrthography(OrthographyElement[] eles) Orthography(Collection<? extends OrthographyElement> elements) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(Visitor<OrthographyElement> visitor) Accept the given visitor.elementAt(int idx) Return utterance level annotations.<T> TgetExtension(Class<T> cap) Get the requested extension if available.Return all extension types supportedGet terminator for utterance (if any.)Return the utterance internal-media element after terminator (if any)booleanDoes utterance have a terminator?booleanDoes this utterance have a media segment after the terminator?intGet element index of the given element.iterator()intlength()static OrthographyparseOrthography(String text) Parse the given text into a newOrthographyobject.<T> TputExtension(Class<T> cap, T impl) Add a new extension.<T> TremoveExtension(Class<T> cap) Remove a capability.intGet the string index of the given element.subsection(int start, int end) Return a new Orthography instance with the given range of elementstoList()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Orthography
public Orthography() -
Orthography
-
Orthography
-
-
Method Details
-
parseOrthography
Parse the given text into a newOrthographyobject.- Throws:
ParseException
-
getExtensions
Description copied from interface:IExtendableReturn all extension types supported- Specified by:
getExtensionsin interfaceIExtendable
-
getExtension
Description copied from interface:IExtendableGet the requested extension if available.- Specified by:
getExtensionin interfaceIExtendable- Returns:
- the capability object or
nullif the cability is not available
-
putExtension
Description copied from interface:IExtendableAdd a new extension.- Specified by:
putExtensionin interfaceIExtendable- Parameters:
cap- the extension to add- Returns:
- the added extension implementation
-
removeExtension
Description copied from interface:IExtendableRemove a capability.- Specified by:
removeExtensionin interfaceIExtendable- Parameters:
cap- the capability to remove
-
accept
Description copied from interface:VisitableAccept the given visitor.- Specified by:
acceptin interfaceVisitable<OrthographyElement>
-
subsection
Return a new Orthography instance with the given range of elements- Parameters:
start-end-- Returns:
-
length
public int length() -
elementAt
-
indexOf
Get element index of the given element. This function does not recurse into groups or phonetic groups.- Parameters:
ele-- Returns:
-
stringIndexOf
Get the string index of the given element. This method will recurse into groups and phonetic groups- Parameters:
ele-- Returns:
- string index or -1 element is not part of this Orthography instance
-
hasTerminator
public boolean hasTerminator()Does utterance have a terminator?- Returns:
- true if terminator found, false otherwise
-
getTerminator
Get terminator for utterance (if any.)- Returns:
- utterance terminator or null if not found
-
hasUtteranceMedia
public boolean hasUtteranceMedia()Does this utterance have a media segment after the terminator?- Returns:
- true if this utterance has an internal-media segment after the terminator
-
getUtteranceMedia
Return the utterance internal-media element after terminator (if any)- Returns:
- utterance media or null
-
getAnnotations
Return utterance level annotations. These annotations must appear after the terminator and postcodes. Utterance level annotations may include markers and errors.- Returns:
- unmodifiable list of annotations at end of utterance
-
toString
-
toList
-
iterator
- Specified by:
iteratorin interfaceIterable<OrthographyElement>
-