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 TypeMethodDescriptionvoid
accept
(Visitor<OrthographyElement> visitor) Accept the given visitor.elementAt
(int idx) Return utterance level annotations.<T> T
getExtension
(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)boolean
Does utterance have a terminator?boolean
Does this utterance have a media segment after the terminator?int
Get element index of the given element.iterator()
int
length()
static Orthography
parseOrthography
(String text) Parse the given text into a newOrthography
object.<T> T
putExtension
(Class<T> cap, T impl) Add a new extension.<T> T
removeExtension
(Class<T> cap) Remove a capability.int
Get 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, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Orthography
public Orthography() -
Orthography
-
Orthography
-
-
Method Details
-
parseOrthography
Parse the given text into a newOrthography
object.- Throws:
ParseException
-
getExtensions
Description copied from interface:IExtendable
Return all extension types supported- Specified by:
getExtensions
in interfaceIExtendable
-
getExtension
Description copied from interface:IExtendable
Get the requested extension if available.- Specified by:
getExtension
in interfaceIExtendable
- Returns:
- the capability object or
null
if the cability is not available
-
putExtension
Description copied from interface:IExtendable
Add a new extension.- Specified by:
putExtension
in interfaceIExtendable
- Parameters:
cap
- the extension to add- Returns:
- the added extension implementation
-
removeExtension
Description copied from interface:IExtendable
Remove a capability.- Specified by:
removeExtension
in interfaceIExtendable
- Parameters:
cap
- the capability to remove
-
accept
Description copied from interface:Visitable
Accept the given visitor.- Specified by:
accept
in 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:
iterator
in interfaceIterable<OrthographyElement>
-