|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jqurantree.arabic.ByteFormat
public class ByteFormat
ByteFormat
is a support class which is used to decode the
internal byte format of ArabicText
. Internally,
Arabic text is represented by a byte buffer, with a fixed width for each
letter, including its diacritics. This class is used when accessing the
byte[]
buffer through ArabicText
and
ArabicCharacter
method calls.
Each ArabicCharacter
is represented by 3 bytes in the buffer.
The first byte encodes the character type. The second and third bytes form a
vector of bits. Each diacritic type has a fixed position in the bit vector,
and if the bit is set then the diacritic is present. The maximum range of
values possible in this encoding scheme would be 256 character types, and
combinations of 16 diacritic types. In practice, only 44
CharacterTypes
and 13 DiacriticTypes
are used.
Field Summary | |
---|---|
static int |
CHARACTER_WIDTH
The number of bytes representing each ArabicCharacter in the
buffer. |
static byte |
WHITESPACE
The buffer byte value representing a space delimiter. |
Method Summary | |
---|---|
static int |
getDiacriticCount(byte[] buffer,
int offset)
Gets the number of diacritics attached to the character. |
static boolean |
isAlifKhanjareeya(byte[] buffer,
int offset)
Determines if Alif Khanjareeya is attached. |
static boolean |
isDamma(byte[] buffer,
int offset)
Determines if a Damma is present. |
static boolean |
isDammatan(byte[] buffer,
int offset)
Determines if Dammatan are present. |
static boolean |
isDiacritic(byte[] buffer,
int offset,
DiacriticType diacriticType)
Determines if a diacritic is present. |
static boolean |
isFatha(byte[] buffer,
int offset)
Determines if a Fatha is present. |
static boolean |
isFathatan(byte[] buffer,
int offset)
Determines if Fathatan are present. |
static boolean |
isHamzaAbove(byte[] buffer,
int offset)
Determines if a Hamza is present above the character. |
static boolean |
isHamzaBelow(byte[] buffer,
int offset)
Determines if a Hamza is present below the character. |
static boolean |
isHamzatWasl(byte[] buffer,
int offset)
Determines if Hamzat Wasl is attached. |
static boolean |
isKasra(byte[] buffer,
int offset)
Determines if a Kasra is present. |
static boolean |
isKasratan(byte[] buffer,
int offset)
Determines if Kasratan are present. |
static boolean |
isLetter(byte[] buffer,
int offset)
Determines if the character is an Arabic letter. |
static boolean |
isMaddah(byte[] buffer,
int offset)
Determines if a Maddah is present. |
static boolean |
isShadda(byte[] buffer,
int offset)
Determines if a Shadda is present. |
static boolean |
isSingleDiacritic(byte[] buffer,
int offset,
DiacriticType diacriticType)
Determines if only a single diacritic is attached. |
static boolean |
isSukun(byte[] buffer,
int offset)
Determines if a Sukun is present. |
static void |
setDiacritic(byte[] buffer,
int offset,
DiacriticType diacriticType)
Sets a diacritic as present. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CHARACTER_WIDTH
ArabicCharacter
in the
buffer.
public static final byte WHITESPACE
byte
value representing a space delimiter.
Method Detail |
---|
public static void setDiacritic(byte[] buffer, int offset, DiacriticType diacriticType)
buffer
- the byte[]
bufferoffset
- the offset of the characterdiacriticType
- the type of diacritic to setpublic static boolean isDiacritic(byte[] buffer, int offset, DiacriticType diacriticType)
buffer
- the byte[]
bufferoffset
- the offset of the characterdiacriticType
- the type of diacritic
true
if the diacritic is present; false
otherwisepublic static boolean isFatha(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if a Fatha is present;
false
otherwise.public static boolean isDamma(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if a Damma is present;
false
otherwise.public static boolean isKasra(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if a Kasra is present;
false
otherwise.public static boolean isFathatan(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if Fathatan are present;
false
otherwise.public static boolean isDammatan(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if Dammatan are present;
false
otherwise.public static boolean isKasratan(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if Kasratan are present;
false
otherwise.public static boolean isShadda(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if a Shadda is present;
false
otherwise.public static boolean isSukun(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if a Sukun is present;
false
otherwise.public static boolean isMaddah(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if a Maddah is present;
false
otherwise.public static boolean isHamzaAbove(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if a Hamza is present above the
character; false
otherwise.public static boolean isHamzaBelow(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if a Hamza is present below the
character; false
otherwise.public static boolean isHamzatWasl(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if Hamzat Wasl is attached;
false
otherwise.public static boolean isAlifKhanjareeya(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if Alif Khanjareeya is attached;
false
otherwise.public static boolean isSingleDiacritic(byte[] buffer, int offset, DiacriticType diacriticType)
buffer
- the byte[]
bufferoffset
- the offset of the characterdiacriticType
- the single diacritic
true
if the character has only the specified
diacritic and no others; false
otherwise.public static int getDiacriticCount(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
public static boolean isLetter(byte[] buffer, int offset)
buffer
- the byte[]
bufferoffset
- the offset of the character
true
if the character is an Arabic letter, and not a
Quranic symbol; false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |