|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdasher.CAlphabet
public class CAlphabet
Represents an Alphabet, including a list of its symbols, their appearance on screen and when typed, and their foreground and background colours.
Note that the colours specified here are mere ordinal numbers; the resolution of these into actual displayable colours is the responsibility of CCustomColours.
This class is also responsible for translating a tract of text
into a sequence of logical symbol identifiers (see
GetSymbols)
| Field Summary | |
|---|---|
SGroupInfo |
m_BaseGroup
Root of the group tree. |
protected java.util.ArrayList<java.lang.String> |
m_Characters
Symbols' representations when typed. |
protected java.util.ArrayList<java.lang.Integer> |
m_Colours
Symbols' background colours, used by CDasherView to display their nodes. |
protected int |
m_ControlSymbol
The symbol number of the control node. |
protected java.lang.String |
m_DefaultPalette
Name of the colour scheme which this alphabet 'prefers' to use. |
protected java.util.ArrayList<java.lang.String> |
m_Display
Symbols' representations on screen. |
protected int |
m_EndConversionSymbol
The symbol number of the End Conversion symbol. |
protected java.util.ArrayList<java.lang.String> |
m_Foreground
Stores the foreground colour of the symbols. |
protected java.lang.String |
m_GameModeFile
|
protected int |
m_Orientation
This alphabet's default orientation. |
protected int |
m_ParagraphSymbol
The symbol number of the new-paragraph character. |
protected int |
m_SpaceSymbol
The symbol number of the space character. |
protected int |
m_StartConversionSymbol
The symbol number of the Start Conversion symbol. |
protected java.lang.String |
m_TrainingFile
Path of a file containing training text relevant to this alphabet. |
protected CAlphabetMap |
TextMap
Mapping from text to symbol numbers, for use in parsing training text. |
| Constructor Summary | |
|---|---|
CAlphabet()
Default constructor; produces an alphabet containing no characters. |
|
CAlphabet(CAlphIO.AlphInfo AlphabetInfo)
Produces a ready-made Alphabet from an AlphInfo class which specifies the alphabet. |
|
| Method Summary | |
|---|---|
void |
AddChar(java.lang.String NewCharacter,
java.lang.String Display,
int Colour,
java.lang.String Foreground)
Adds a new character to this alphabet. |
void |
AddControlSymbol(java.lang.String NewCharacter,
java.lang.String Display,
int Colour,
java.lang.String Foreground)
Adds a control symbol to the alphabet. |
void |
AddEndConversionSymbol(java.lang.String NewCharacter,
java.lang.String Display,
int Colour,
java.lang.String Foreground)
Adds an end-conversion symbol top the alphabet. |
void |
AddParagraphSymbol(java.lang.String NewCharacter,
java.lang.String Display,
int Colour,
java.lang.String Foreground)
Adds a paragraph symbol to the alphabet. |
void |
AddSpaceSymbol(java.lang.String NewCharacter,
java.lang.String Display,
int Colour,
java.lang.String Foreground)
Adds a space symbol to the alphabet. |
void |
AddStartConversionSymbol(java.lang.String NewCharacter,
java.lang.String Display,
int Colour,
java.lang.String Foreground)
Adds a start-conversion symbol top the alphabet. |
CAlphabetMap |
GetAlphabetMap()
Gets the instance of CAlphabetMap which maps Strings to symbols in this Alphabet. |
int |
GetColour(int i)
Retrieves the background colour for a given symbol. |
java.util.ArrayList<java.lang.Integer> |
GetColours()
Gets a reference to the array of background colours used when drawing symbols. |
int |
GetControlSymbol()
Gets the index of this alphabet's control symbol. |
java.lang.String |
GetDisplayText(int i)
Retrieves the String which should be displayed to represent a given character. |
java.util.ArrayList<java.lang.String> |
GetDisplayTexts()
Gets the array of display texts. |
int |
GetEndConversionSymbol()
Gets the index of this alphabet's end-conversion symbol. |
java.lang.String |
GetForeground(int i)
Retrieves the foreground (text) colour for a given symbol. |
java.lang.String |
GetGameModeFile()
|
int |
GetNumberSymbols()
Gets number of symbols in this alphabet, including special characters. |
int |
GetNumberTextSymbols()
Gets the number of symbols in this alphabet which are not 'special symbols' (eg the Control symbol). |
int |
GetOrientation()
Gets the orientation associated with this alphabet. |
java.lang.String |
GetPalette()
Gets the name of the colour scheme preferred by this alphabet. |
int |
GetParagraphSymbol()
Gets the index of this alphabet's paragraph symbol. |
int |
GetSpaceSymbol()
Gets the index of this alphabet's space symbol. |
int |
GetStartConversionSymbol()
Gets the index of this alphabet's start-conversion symbol. |
void |
GetSymbols(java.util.Collection<java.lang.Integer> Symbols,
java.lang.String Input,
boolean IsMore)
Converts a string of text into a list of symbol indentifiers. |
java.lang.String |
GetText(int i)
Retrieves the typed character representation of a given symbol. |
int |
GetTextColour(int Symbol)
Retrieves the text colour to be used in drawing the specified symbol. |
java.lang.String |
GetTrainingFile()
Gets the training file to be used training a language model which uses this alphabet. |
void |
SetGameModeFile(java.lang.String GameModeFile)
|
void |
SetOrientation(int Orientation)
Sets the preferred orientation for this alphabet. |
void |
SetPalette(java.lang.String Palette)
Sets this alphabet's preferred colour scheme. |
void |
SetTrainingFile(java.lang.String TrainingFile)
Sets the training file to be used training a language model which uses this alphabet. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int m_Orientation
protected int m_ParagraphSymbol
protected int m_SpaceSymbol
protected int m_ControlSymbol
protected int m_StartConversionSymbol
protected int m_EndConversionSymbol
protected java.lang.String m_TrainingFile
protected java.lang.String m_GameModeFile
protected java.lang.String m_DefaultPalette
protected java.util.ArrayList<java.lang.String> m_Characters
protected java.util.ArrayList<java.lang.String> m_Display
protected java.util.ArrayList<java.lang.Integer> m_Colours
protected java.util.ArrayList<java.lang.String> m_Foreground
public SGroupInfo m_BaseGroup
protected CAlphabetMap TextMap
| Constructor Detail |
|---|
public CAlphabet()
public CAlphabet(CAlphIO.AlphInfo AlphabetInfo)
The alphabet produced will have special characters (such as the start conversion character) only if AlphabetInfo specifies their text as having non-zero length.
AlphabetInfo - The AlphInfo class containing the
alphabet specification.CAlphIO,
CAlphIO.AlphInfo| Method Detail |
|---|
public void GetSymbols(java.util.Collection<java.lang.Integer> Symbols,
java.lang.String Input,
boolean IsMore)
Symbols - Collection to be filled with symbol identifiers.Input - String to be converted.IsMore - Redundant parameter; used to signal that the last
input character may be an incomplete UTF-8
character, but redundant since UTF-16 is now
used internally.
public void AddChar(java.lang.String NewCharacter,
java.lang.String Display,
int Colour,
java.lang.String Foreground)
NewCharacter - Representation of this character as to be shown in textual output.Display - Representation to be shown on screen.Colour - Background colour index to be used in drawing nodes containing this character.Foreground - Foreground colour to be used drawing the text..
public void AddParagraphSymbol(java.lang.String NewCharacter,
java.lang.String Display,
int Colour,
java.lang.String Foreground)
NewCharacter - Representation of this character as to be shown in textual output.Display - Representation to be shown on screen.Colour - Background colour index to be used in drawing nodes containing this character.Foreground - Foreground colour to be used drawing the text..
public void AddSpaceSymbol(java.lang.String NewCharacter,
java.lang.String Display,
int Colour,
java.lang.String Foreground)
NewCharacter - Representation of this character as to be shown in textual output.Display - Representation to be shown on screen.Colour - Background colour index to be used in drawing nodes containing this character.Foreground - Foreground colour to be used drawing the text..
public void AddControlSymbol(java.lang.String NewCharacter,
java.lang.String Display,
int Colour,
java.lang.String Foreground)
NewCharacter - Redundant; the Control character is not typed.Display - Representation to be shown on screen. (typically 'Control')Colour - Background colour index to be used in drawing nodes containing this character.Foreground - Foreground colour to be used drawing the text..
public void AddStartConversionSymbol(java.lang.String NewCharacter,
java.lang.String Display,
int Colour,
java.lang.String Foreground)
NewCharacter - Redundant; the conversion symbol is not a typed character in the ordinary sense.Display - Representation to be shown on screen.Colour - Background colour index to be used in drawing nodes containing this character.Foreground - Foreground colour to be used drawing the text..
public void AddEndConversionSymbol(java.lang.String NewCharacter,
java.lang.String Display,
int Colour,
java.lang.String Foreground)
NewCharacter - Redundant; the end-conversion symbol is not typed in the ordinary sense.Display - Representation to be shown on screen.Colour - Background colour index to be used in drawing nodes containing this character.Foreground - Foreground colour to be used drawing the text..public int GetTextColour(int Symbol)
Symbol - Symbol whose colour is to be looked up.
public int GetNumberSymbols()
public int GetNumberTextSymbols()
This method needs improving to correctly recognise the start conversion symbol.
public int GetOrientation()
public java.lang.String GetTrainingFile()
public java.lang.String GetGameModeFile()
public java.lang.String GetPalette()
public java.util.ArrayList<java.lang.String> GetDisplayTexts()
public java.lang.String GetDisplayText(int i)
i - Index of the character to be looked up.
public java.lang.String GetText(int i)
i - Symbol to look up
public java.util.ArrayList<java.lang.Integer> GetColours()
public int GetColour(int i)
i - Symbol indentifier
public java.lang.String GetForeground(int i)
i - Symbol identifier.
public void SetOrientation(int Orientation)
Orientation - New orientation.public void SetTrainingFile(java.lang.String TrainingFile)
TrainingFile - New training file location.public void SetGameModeFile(java.lang.String GameModeFile)
public void SetPalette(java.lang.String Palette)
Palette - Name of the new scheme.public CAlphabetMap GetAlphabetMap()
public int GetParagraphSymbol()
public int GetSpaceSymbol()
public int GetControlSymbol()
public int GetStartConversionSymbol()
public int GetEndConversionSymbol()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||