|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectAlphabet
This class implements the alphabet. Internally, for automata, grammars
or transducers, the alphabet is always a set of consecutive integers
beginning with 0.
| Constructor Summary | |
Alphabet(boolean[] isLetter)
Creates an alphabet from a boolean array isLetter |
|
Alphabet(char[] chars)
Creates an alphabet consisting in a set given in an array of characters. |
|
Alphabet(char letter,
int n)
Creates an alphabet of size n beginning
at character letter |
|
Alphabet(int n)
Creates an alphabet of size n beginning at character
a. |
|
Alphabet(java.util.Set charSet)
Creates an alphabet consisting in a set of characters. |
|
| Method Summary | |
static void |
addToCharSet(java.lang.String line,
boolean[] isLetter)
|
short |
convert(Alphabet a,
short i)
Converts the short integer i
to its value in the alphabet a. |
static Alphabet |
english()
The english alphabet. |
static Alphabet |
french()
The french alphabet. |
static Alphabet |
fromExpression(java.lang.String exp)
Returns the alphabet composed of the letters appearing in the expression exp (used to create an alphabet from a regular expression). |
static Alphabet |
fromFile(java.lang.String name)
Returns the alphabet composed of all the characters appearing in the file name. |
boolean |
isIn(char c)
Returns true if the character c is in the alphabet. |
static void |
main(java.lang.String[] args)
|
java.util.Set |
toChar(java.util.Set s)
Converts to characters the elements of the set of Short
s. |
short |
toShort(char c)
Translates the character c to a short integer
using the array charToShort. |
short[] |
toShort(java.lang.String w)
Translates the String w to Short using the method
toShort(). |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Alphabet(char letter,
int n)
n beginning
at character letter
public Alphabet(boolean[] isLetter)
isLetter
public Alphabet(int n)
n beginning at character
a.
public Alphabet(java.util.Set charSet)
public Alphabet(char[] chars)
| Method Detail |
public static Alphabet french()
public static Alphabet english()
public static Alphabet fromFile(java.lang.String name)
throws java.lang.Exception
name.
java.lang.Exceptionpublic static Alphabet fromExpression(java.lang.String exp)
exp (used to create an alphabet from a regular expression).
public static void addToCharSet(java.lang.String line,
boolean[] isLetter)
public short toShort(char c)
c to a short integer
using the array charToShort.
public short[] toShort(java.lang.String w)
w to Short using the method
toShort().
public java.util.Set toChar(java.util.Set s)
Short
s.
public boolean isIn(char c)
c is in the alphabet.
public short convert(Alphabet a,
short i)
i
to its value in the alphabet a.
public java.lang.String toString()
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||