public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
containsPonc(String s) |
static Retaggable |
demutate(String in) |
static String |
eclipse(String in)
eclipses a word
("Eclipsis" in Irish grammar is an initial mutation,
represented as a prefix to the word that replaces
the pronunciation of the letter for consonants, i.e.,
'f' is eclipsed as 'bh' - 'focal' becomes 'bhfocal' -
but only 'bh' (not 'f') is pronounced; or, with vowels,
an initial 'n' is added (hyphenated before a lowercase
word, lowercased but not hyphenated before an uppercase
or titlecase word).
|
static Retaggable |
fixSuffix(String in) |
static String |
greekToLatin(String s) |
static String |
halfwidthLatinToLatin(String s) |
static boolean |
hasMixedGreekAndCyrillic(String s) |
static boolean |
hasMixedGreekAndLatin(String s) |
static boolean |
isAllHalfWidthChars(String s) |
static boolean |
isAllMathsChars(String s) |
static boolean |
isAllUppercase(String s) |
static boolean |
isLowerLenitable(char c) |
static boolean |
isLowerVowel(char c) |
static boolean |
isPonc(char c)
Check if the character is dotted ('ponc' in Irish)
|
static boolean |
isSLenitable(char c)
The (non-definite) eclipsed form of 's', 'sh',
is pronounced like 'h' in English; words beginning
with 's' can only have lenition applied if the
following letter would be easily pronounced after
this sound: this function checks if the that second
letter is one of them
|
static boolean |
isUpperLenitable(char c) |
static boolean |
isUpperVowel(char c) |
static boolean |
isVowel(char c) |
static String |
lenite(String in)
lenites a word
("Lenition" in Irish grammar is an initial mutation,
historically related to phonetic lenition; its
written representation is an 'h' after the initial
consonant).
|
static List<Retaggable> |
morphWord(String in) |
static String |
simplifyMathematical(String s) |
static String |
simplifyMathematical(String s,
boolean normaliseGreek,
boolean normaliseDigits) |
static boolean |
startsWithUppercase(String s)
Equivalent of
StringTools.startsWithUppercase(String) ,
adapted for Irish case folding oddities. |
static String |
toLowerCaseIrish(String s)
Case folding in Irish is non-trivial: initial mutations that
prefix the word are always written in lowercase; 'n' and 't'
are written with a hyphen before a lowercase vowel.
|
static String |
unEclipse(String in) |
static String |
unEclipseChar(String in,
char first,
char second)
Helper to uneclipse single-letter consonant eclipsis (i.e., not bhfear or
n-éin), handling miscapitalised eclipsed words: Gcarr -> Carr, etc.
|
static String |
unEclipseF(String in) |
static String |
unLenite(String in)
Attempts to unlenite a string (See
lenite(String) )
Deliberately does not check if first character is one
that ought to be lenited (this can be checked in XML rules) |
static String |
unLeniteDefiniteS(String in)
Removes lenition from a word beginning with 's', following
the definite article; as an exception to conventional
lenition, this is a 't' prefix.
|
static String |
unPonc(String s)
Converts pre-standard lenition to modern
(converts dotted (= ponc) letters to the equivalent
undotted, followed by 'h'
|
public static Retaggable fixSuffix(String in)
public static List<Retaggable> morphWord(String in)
public static Retaggable demutate(String in)
public static String unLenite(String in)
lenite(String)
)
Deliberately does not check if first character is one
that ought to be lenited (this can be checked in XML rules)public static String unLeniteDefiniteS(String in)
in
- The written formpublic static String unEclipseChar(String in, char first, char second)
in
- string to uneclipsefirst
- first (eclipsis) charactersecond
- second character; first character of the word properpublic static boolean isUpperVowel(char c)
public static boolean isLowerVowel(char c)
public static boolean isVowel(char c)
public static boolean isUpperLenitable(char c)
public static boolean isLowerLenitable(char c)
public static boolean isSLenitable(char c)
c
- The second letter of a word beginning with 's'public static String lenite(String in)
in
- word form to be lenitedpublic static String eclipse(String in)
in
- word form to be eclipsedpublic static String toLowerCaseIrish(String s)
s
- the word to lowercasepublic static boolean startsWithUppercase(String s)
StringTools.startsWithUppercase(String)
,
adapted for Irish case folding oddities.s
- String to checkpublic static boolean isAllUppercase(String s)
public static boolean isPonc(char c)
c
- the character to checkpublic static boolean containsPonc(String s)
public static String unPonc(String s)
s
- string to convertpublic static boolean isAllMathsChars(String s)
public static boolean isAllHalfWidthChars(String s)
public static String simplifyMathematical(String s, boolean normaliseGreek, boolean normaliseDigits)
public static boolean hasMixedGreekAndLatin(String s)
public static boolean hasMixedGreekAndCyrillic(String s)