Package ca.phon.orthography
Class OrthographyBuilder
java.lang.Object
ca.phon.orthography.OrthographyBuilder
Class for building
Orthography
from various sources. This class
is not thread-safe.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionappend
(OrthoElement ele) append
(Orthography ortho) appendComment
(String data) appendComment
(String type, String data) appendEvent
(String type, String data) appendPunct
(char punct) Append punctuation.appendPunct
(OrthoPunctType type) appendWord
(String data) appendWord
(String data, WordPrefixType prefix) appendWord
(String data, WordPrefixType prefix, WordSuffixType suffix) appendWord
(String data, WordPrefixType prefix, WordSuffixType suffix, UntranscribedType untranscribed) appendWord
(String data, WordSuffixType suffix) appendWordnet
(OrthoWord word1, OrthoWord word2, OrthoWordnetMarker marker) clear()
Creates a wordnet using the last two elements.createWordnet
(OrthoWordnetMarker marker) Creates a wordnet using the last two elements.createWordnet
(OrthoWord word2, OrthoWordnetMarker marker) Creates a wordnet using the previously added word and the given word.elementAt
(int idx) int
size()
-
Constructor Details
-
OrthographyBuilder
public OrthographyBuilder()
-
-
Method Details
-
clear
-
append
-
append
-
append
- Parameters:
txt
-- Returns:
- Throws:
IllegalArgumentException
- if txt could not be compiled
-
appendWord
public OrthographyBuilder appendWord(String data, WordPrefixType prefix, WordSuffixType suffix, UntranscribedType untranscribed) -
appendWord
-
appendWord
-
appendWord
-
appendWord
-
appendComment
-
appendComment
-
appendWordnet
public OrthographyBuilder appendWordnet(OrthoWord word1, OrthoWord word2, OrthoWordnetMarker marker) -
createWordnet
Creates a wordnet using the previously added word and the given word.- Parameters:
word2
-marker
-- Returns:
- Throws:
IllegalStateException
- if the previous element is not anOrthoWord
or the element list is empty
-
createWordnet
Creates a wordnet using the last two elements.- Parameters:
marker
-- Returns:
- Throws:
IllegalStateException
- if the previous two elements are notOrthoWord
s or the element list is empty
-
createWordnet
Creates a wordnet using the last two elements.- Returns:
- Throws:
IllegalStateException
- if the previous two elements are notOrthoWord
s or the element list is empty
-
appendPunct
-
appendPunct
Append punctuation.- Parameters:
punct
-- Returns:
- Throws:
IllegalArgumentException
- if the given text is not valid
-
size
public int size() -
elementAt
-
appendEvent
-
toOrthography
-