PersianShaping

Created Diff never expires
16 removals
Lines
Total
Removed
Words
Total
Removed
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
648 lines
12 additions
Lines
Total
Added
Words
Total
Added
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
644 lines
// © 2016 and later: Unicode, Inc. and others.
//© 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
//License & terms of use: http://www.unicode.org/copyright.html#License
/*
/*
*******************************************************************************
*******************************************************************************
* Copyright (C) 2001-2012, International Business Machines
* Copyright (C) 2001-2012, International Business Machines
* Corporation and others. All Rights Reserved.
* Corporation and others. All Rights Reserved.
*******************************************************************************
*******************************************************************************
*/
*/
import com.ibm.icu.impl.UBiDiProps;
import com.ibm.icu.impl.UBiDiProps;
import com.ibm.icu.lang.UCharacterDirection;
import com.ibm.icu.lang.UCharacterDirection;
import com.ibm.icu.text.ArabicShapingException;
/**
/**
* Shape Arabic text on a character basis.
* Shape Persian text on a character basis. - Edited by soheil rahsaz
*
*
* <p>ArabicShaping performs basic operations for "shaping" Arabic text. It is most
* <p>PersianShaping performs basic operations for "shaping" Arabic text. It is most
* useful for use with legacy data formats and legacy display technology
* useful for use with legacy data formats and legacy display technology
* (simple terminals). All operations are performed on Unicode characters.</p>
* (simple terminals). All operations are performed on Unicode characters.</p>
*
*
* <p>Text-based shaping means that some character code points in the text are
* <p>Text-based shaping means that some character code points in the text are
* replaced by others depending on the context. It transforms one kind of text
* replaced by others depending on the context. It transforms one kind of text
* into another. In comparison, modern displays for Arabic text select
* into another. In comparison, modern displays for Arabic text select
* appropriate, context-dependent font glyphs for each text element, which means
* appropriate, context-dependent font glyphs for each text element, which means
* that they transform text into a glyph vector.</p>
* that they transform text into a glyph vector.</p>
*
*
* <p>Text transformations are necessary when modern display technology is not
* <p>Text transformations are necessary when modern display technology is not
* available or when text needs to be transformed to or from legacy formats that
* available or when text needs to be transformed to or from legacy formats that
* use "shaped" characters. Since the Arabic script is cursive, connecting
* use "shaped" characters. Since the Arabic script is cursive, connecting
* adjacent letters to each other, computers select images for each letter based
* adjacent letters to each other, computers select images for each letter based
* on the surrounding letters. This usually results in four images per Arabic
* on the surrounding letters. This usually results in four images per Arabic
* letter: initial, middle, final, and isolated forms. In Unicode, on the other
* letter: initial, middle, final, and isolated forms. In Unicode, on the other
* hand, letters are normally stored abstract, and a display system is expected
* hand, letters are normally stored abstract, and a display system is expected
* to select the necessary glyphs. (This makes searching and other text
* to select the necessary glyphs. (This makes searching and other text
* processing easier because the same letter has only one code.) It is possible
* processing easier because the same letter has only one code.) It is possible
* to mimic this with text transformations because there are characters in
* to mimic this with text transformations because there are characters in
* Unicode that are rendered as letters with a specific shape
* Unicode that are rendered as letters with a specific shape
* (or cursive connectivity). They were included for interoperability with
* (or cursive connectivity). They were included for interoperability with
* legacy systems and codepages, and for unsophisticated display systems.</p>
* legacy systems and codepages, and for unsophisticated display systems.</p>
*
*
* <p>A second kind of text transformations is supported for Arabic digits:
* <p>A second kind of text transformations is supported for Arabic digits:
* For compatibility with legacy codepages that only include European digits,
* For compatibility with legacy codepages that only include European digits,
* it is possible to replace one set of digits by another, changing the
* it is possible to replace one set of digits by another, changing the
* character code points. These operations can be performed for either
* character code points. These operations can be performed for either
* Arabic-Indic Digits (U+0660...U+0669) or Eastern (Extended) Arabic-Indic
* Arabic-Indic Digits (U+0660...U+0669) or Eastern (Extended) Arabic-Indic
* digits (U+06f0...U+06f9).</p>
* digits (U+06f0...U+06f9).</p>
*
*
* <p>Some replacements may result in more or fewer characters (code points).
* <p>Some replacements may result in more or fewer characters (code points).
* By default, this means that the destination buffer may receive text with a
* By default, this means that the destination buffer may receive text with a
* length different from the source length. Some legacy systems rely on the
* length different from the source length. Some legacy systems rely on the
* length of the text to be constant. They expect extra spaces to be added
* length of the text to be constant. They expect extra spaces to be added
* or consumed either next to the affected character or at the end of the
* or consumed either next to the affected character or at the end of the
* text.</p>
* text.</p>
* @stable ICU 2.0
* @stable ICU 2.0
* @author Edited: Soheil Rahsaz
*/
*/
public final class ArabicShaping {
public final class PersianShaping {
private final int options;
private final int options;
private boolean isLogical; // convenience
private boolean isLogical; // convenience
private boolean spacesRelativeToTextBeginEnd;
private boolean spacesRelativeToTextBeginEnd;
private char tailChar;
private char tailChar;
/**
/**
* Convert a range of text in the source array, putting the result
* Convert a range of text in the source array, putting the result
* into a range of text in the destination array, and return the number
* into a range of text in the destination array, and return the number
* of characters written.
* of characters written.
*
*
* @param source An array containing the input text
* @param source An array containing the input text
* @param sourceStart The start of the range of text to convert
* @param sourceStart The start of the range of text to convert
* @param sourceLength The length of the range of text to convert
* @param sourceLength The length of the range of text to convert
* @param dest The destination array that will receive the result.
* @param dest The destination array that will receive the result.
* It may be <code>NULL</code> only if <code>destSize</code> is 0.
* It may be <code>NULL</code> only if <code>destSize</code> is 0.
* @param destStart The start of the range of the destination buffer to use.
* @param destStart The start of the range of the destination buffer to use.
* @param destSize The size (capacity) of the destination buffer.
* @param destSize The size (capacity) of the destination buffer.
* If <code>destSize</code> is 0, then no output is produced,
* If <code>destSize</code> is 0, then no output is produced,
* but the necessary buffer size is returned ("preflighting"). This
* but the necessary buffer size is returned ("preflighting"). This
* does not validate the text against the options, for example,
* does not validate the text against the options, for example,
* if letters are being unshaped, and spaces are being consumed
* if letters are being unshaped, and spaces are being consumed
* following lamalef, this will not detect a lamalef without a
* following lamalef, this will not detect a lamalef without a
* corresponding space. An error will be thrown when the actual
* corresponding space. An error will be thrown when the actual
* conversion is attempted.
* conversion is attempted.
* @return The number of chars written to the destination buffer.
* @return The number of chars written to the destination buffer.
* If an error occurs, then no output was written, or it may be
* If an error occurs, then no output was written, or it may be
* incomplete.
* incomplete.
* @throws ArabicShapingException if the text cannot be converted according to the options.
* @throws ArabicShapingException if the text cannot be converted according to the options.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public int shape(char[] source, int sourceStart, int sourceLength,
public int shape(char[] source, int sourceStart, int sourceLength,
char[] dest, int destStart, int destSize) throws ArabicShapingException {
char[] dest, int destStart, int destSize) throws ArabicShapingException {
if (source == null) {
if (source == null) {
throw new IllegalArgumentException("source can not be null");
throw new IllegalArgumentException("source can not be null");
}
}
if (sourceStart < 0 || sourceLength < 0 || sourceStart + sourceLength > source.length) {
if (sourceStart < 0 || sourceLength < 0 || sourceStart + sourceLength > source.length) {
throw new IllegalArgumentException("bad source start (" + sourceStart +
throw new IllegalArgumentException("bad source start (" + sourceStart +
") or length (" + sourceLength +
") or length (" + sourceLength +
") for buffer of length " + source.length);
") for buffer of length " + source.length);
}
}
if (dest == null && destSize != 0) {
if (dest == null && destSize != 0) {
throw new IllegalArgumentException("null dest requires destSize == 0");
throw new IllegalArgumentException("null dest requires destSize == 0");
}
}
if ((destSize != 0) &&
if ((destSize != 0) &&
(destStart < 0 || destSize < 0 || destStart + destSize > dest.length)) {
(destStart < 0 || destSize < 0 || destStart + destSize > dest.length)) {
throw new IllegalArgumentException("bad dest start (" + destStart +
throw new IllegalArgumentException("bad dest start (" + destStart +
") or size (" + destSize +
") or size (" + destSize +
") for buffer of length " + dest.length);
") for buffer of length " + dest.length);
}
}
/* Validate input options */
/* Validate input options */
if ( ((options&TASHKEEL_MASK) != 0) &&
if ( ((options&TASHKEEL_MASK) != 0) &&
!(((options & TASHKEEL_MASK)==TASHKEEL_BEGIN) ||
!(((options & TASHKEEL_MASK)==TASHKEEL_BEGIN) ||
((options & TASHKEEL_MASK)==TASHKEEL_END) ||
((options & TASHKEEL_MASK)==TASHKEEL_END) ||
((options & TASHKEEL_MASK)==TASHKEEL_RESIZE) ||
((options & TASHKEEL_MASK)==TASHKEEL_RESIZE) ||
((options & TASHKEEL_MASK)==TASHKEEL_REPLACE_BY_TATWEEL))) {
((options & TASHKEEL_MASK)==TASHKEEL_REPLACE_BY_TATWEEL))) {
throw new IllegalArgumentException("Wrong Tashkeel argument");
throw new IllegalArgumentException("Wrong Tashkeel argument");
}
}
///CLOVER:OFF
///CLOVER:OFF
//According to Steven Loomis, the code is unreachable when you OR all the constants within the if statements
//According to Steven Loomis, the code is unreachable when you OR all the constants within the if statements
if(((options&LAMALEF_MASK) != 0) &&
if(((options&LAMALEF_MASK) != 0) &&
!(((options & LAMALEF_MASK)==LAMALEF_BEGIN) ||
!(((options & LAMALEF_MASK)==LAMALEF_BEGIN) ||
((options & LAMALEF_MASK)==LAMALEF_END) ||
((options & LAMALEF_MASK)==LAMALEF_END) ||
((options & LAMALEF_MASK)==LAMALEF_RESIZE) ||
((options & LAMALEF_MASK)==LAMALEF_RESIZE) ||
((options & LAMALEF_MASK)==LAMALEF_AUTO) ||
((options & LAMALEF_MASK)==LAMALEF_AUTO) ||
((options & LAMALEF_MASK)==LAMALEF_NEAR))) {
((options & LAMALEF_MASK)==LAMALEF_NEAR))) {
throw new IllegalArgumentException("Wrong Lam Alef argument");
throw new IllegalArgumentException("Wrong Lam Alef argument");
}
}
///CLOVER:ON
///CLOVER:ON
/* Validate Tashkeel (Tashkeel replacement options should be enabled in shaping mode only)*/
/* Validate Tashkeel (Tashkeel replacement options should be enabled in shaping mode only)*/
if(((options&TASHKEEL_MASK) != 0) && (options&LETTERS_MASK) == LETTERS_UNSHAPE) {
if(((options&TASHKEEL_MASK) != 0) && (options&LETTERS_MASK) == LETTERS_UNSHAPE) {
throw new IllegalArgumentException("Tashkeel replacement should not be enabled in deshaping mode ");
throw new IllegalArgumentException("Tashkeel replacement should not be enabled in deshaping mode ");
}
}
return internalShape(source, sourceStart, sourceLength, dest, destStart, destSize);
return internalShape(source, sourceStart, sourceLength, dest, destStart, destSize);
}
}
/**
/**
* Convert a range of text in place. This may only be used if the Length option
* Convert a range of text in place. This may only be used if the Length option
* does not grow or shrink the text.
* does not grow or shrink the text.
*
*
* @param source An array containing the input text
* @param source An array containing the input text
* @param start The start of the range of text to convert
* @param start The start of the range of text to convert
* @param length The length of the range of text to convert
* @param length The length of the range of text to convert
* @throws ArabicShapingException if the text cannot be converted according to the options.
* @throws ArabicShapingException if the text cannot be converted according to the options.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public void shape(char[] source, int start, int length) throws ArabicShapingException {
public void shape(char[] source, int start, int length) throws ArabicShapingException {
if ((options & LAMALEF_MASK) == LAMALEF_RESIZE) {
if ((options & LAMALEF_MASK) == LAMALEF_RESIZE) {
throw new ArabicShapingException("Cannot shape in place with length option resize.");
throw new ArabicShapingException("Cannot shape in place with length option resize.");
}
}
shape(source, start, length, source, start, length);
shape(source, start, length, source, start, length);
}
}
/**
/**
* Convert a string, returning the new string.
* Convert a string, returning the new string.
*
*
* @param text the string to convert
* @param text the string to convert
* @return the converted string
* @return the converted string
* @throws ArabicShapingException if the string cannot be converted according to the options.
* @throws ArabicShapingException if the string cannot be converted according to the options.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public String shape(String text) throws ArabicShapingException {
public String shape(String text) throws ArabicShapingException {
char[] src = text.toCharArray();
char[] src = text.toCharArray();
char[] dest = src;
char[] dest = src;
if (((options & LAMALEF_MASK) == LAMALEF_RESIZE) &&
if (((options & LAMALEF_MASK) == LAMALEF_RESIZE) &&
((options & LETTERS_MASK) == LETTERS_UNSHAPE)) {
((options & LETTERS_MASK) == LETTERS_UNSHAPE)) {
dest = new char[src.length * 2]; // max
dest = new char[src.length * 2]; // max
}
}
int len = shape(src, 0, src.length, dest, 0, dest.length);
int len = shape(src, 0, src.length, dest, 0, dest.length);
return new String(dest, 0, len);
return new String(dest, 0, len);
}
}
/**
/**
* Construct ArabicShaping using the options flags.
* Construct PersianShaping using the options flags.
* The flags are as follows:<br>
* The flags are as follows:<br>
* 'LENGTH' flags control whether the text can change size, and if not,
* 'LENGTH' flags control whether the text can change size, and if not,
* how to maintain the size of the text when LamAlef ligatures are
* how to maintain the size of the text when LamAlef ligatures are
* formed or broken.<br>
* formed or broken.<br>
* 'TEXT_DIRECTION' flags control whether the text is read and written
* 'TEXT_DIRECTION' flags control whether the text is read and written
* in visual order or in logical order.<br>
* in visual order or in logical order.<br>
* 'LETTERS_SHAPE' flags control whether conversion is to or from
* 'LETTERS_SHAPE' flags control whether conversion is to or from
* presentation forms.<br>
* presentation forms.<br>
* 'DIGITS' flags control whether digits are shaped, and whether from
* 'DIGITS' flags control whether digits are shaped, and whether from
* European to Arabic-Indic or vice-versa.<br>
* European to Arabic-Indic or vice-versa.<br>
* 'DIGIT_TYPE' flags control whether standard or extended Arabic-Indic
* 'DIGIT_TYPE' flags control whether standard or extended Arabic-Indic
* digits are used when performing digit conversion.
* digits are used when performing digit conversion.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public ArabicShaping(int options) {
public PersianShaping(int options) {
this.options = options;
this.options = options;
if ((options & DIGITS_MASK) > 0x80) {
if ((options & DIGITS_MASK) > 0x80) {
throw new IllegalArgumentException("bad DIGITS options");
throw new IllegalArgumentException("bad DIGITS options");
}
}
isLogical = ( (options & TEXT_DIRECTION_MASK) == TEXT_DIRECTION_LOGICAL );
isLogical = ( (options & TEXT_DIRECTION_MASK) == TEXT_DIRECTION_LOGICAL );
/* Validate options */
/* Validate options */
spacesRelativeToTextBeginEnd = ( (options & SPACES_RELATIVE_TO_TEXT_MASK) == SPACES_RELATIVE_TO_TEXT_BEGIN_END );
spacesRelativeToTextBeginEnd = ( (options & SPACES_RELATIVE_TO_TEXT_MASK) == SPACES_RELATIVE_TO_TEXT_BEGIN_END );
if ( (options&SHAPE_TAIL_TYPE_MASK) == SHAPE_TAIL_NEW_UNICODE){
if ( (options&SHAPE_TAIL_TYPE_MASK) == SHAPE_TAIL_NEW_UNICODE){
tailChar = NEW_TAIL_CHAR;
tailChar = NEW_TAIL_CHAR;
} else {
} else {
tailChar = OLD_TAIL_CHAR;
tailChar = OLD_TAIL_CHAR;
}
}
}
}
/* Seen Tail options */
/* Seen Tail options */
/**
/**
* Memory option: the result must have the same length as the source.
* Memory option: the result must have the same length as the source.
* Shaping mode: The SEEN family character will expand into two characters using space near
* Shaping mode: The SEEN family character will expand into two characters using space near
* the SEEN family character(i.e. the space after the character).
* the SEEN family character(i.e. the space after the character).
* if there are no spaces found, ArabicShapingException will be thrown
* if there are no spaces found, ArabicShapingException will be thrown
*
*
* De-shaping mode: Any Seen character followed by Tail character will be
* De-shaping mode: Any Seen character followed by Tail character will be
* replaced by one cell Seen and a space will replace the Tail.
* replaced by one cell Seen and a space will replace the Tail.
* Affects: Seen options
* Affects: Seen options
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int SEEN_TWOCELL_NEAR = 0x200000;
public static final int SEEN_TWOCELL_NEAR = 0x200000;
/** Bit mask for Seen memory options.
/** Bit mask for Seen memory options.
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int SEEN_MASK = 0x700000;
public static final int SEEN_MASK = 0x700000;
/* YehHamza options */
/* YehHamza options */
/**
/**
* Memory option: the result must have the same length as the source.
* Memory option: the result must have the same length as the source.
* Shaping mode: The YEHHAMZA character will expand into two characters using space near it
* Shaping mode: The YEHHAMZA character will expand into two characters using space near it
* (i.e. the space after the character)
* (i.e. the space after the character)
* if there are no spaces found, ArabicShapingException will be thrown
* if there are no spaces found, ArabicShapingException will be thrown
*
*
* De-shaping mode: Any Yeh (final or isolated) character followed by Hamza character will be
* De-shaping mode: Any Yeh (final or isolated) character followed by Hamza character will be
* replaced by one cell YehHamza and space will replace the Hamza.
* replaced by one cell YehHamza and space will replace the Hamza.
* Affects: YehHamza options
* Affects: YehHamza options
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int YEHHAMZA_TWOCELL_NEAR = 0x1000000;
public static final int YEHHAMZA_TWOCELL_NEAR = 0x1000000;
/** Bit mask for YehHamza memory options.
/** Bit mask for YehHamza memory options.
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int YEHHAMZA_MASK = 0x3800000;
public static final int YEHHAMZA_MASK = 0x3800000;
/* New Tashkeel options */
/* New Tashkeel options */
/**
/**
* Memory option: the result must have the same length as the source.
* Memory option: the result must have the same length as the source.
* Shaping mode: Tashkeel characters will be replaced by spaces.
* Shaping mode: Tashkeel characters will be replaced by spaces.
* Spaces will be placed at beginning of the buffer
* Spaces will be placed at beginning of the buffer
*
*
* De-shaping mode: N/A
* De-shaping mode: N/A
* Affects: Tashkeel options
* Affects: Tashkeel options
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int TASHKEEL_BEGIN = 0x40000;
public static final int TASHKEEL_BEGIN = 0x40000;
/**
/**
* Memory option: the result must have the same length as the source.
* Memory option: the result must have the same length as the source.
* Shaping mode: Tashkeel characters will be replaced by spaces.
* Shaping mode: Tashkeel characters will be replaced by spaces.
* Spaces will be placed at end of the buffer
* Spaces will be placed at end of the buffer
*
*
* De-shaping mode: N/A
* De-shaping mode: N/A
* Affects: Tashkeel options
* Affects: Tashkeel options
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int TASHKEEL_END = 0x60000;
public static final int TASHKEEL_END = 0x60000;
/**
/**
* Memory option: allow the result to have a different length than the source.
* Memory option: allow the result to have a different length than the source.
* Shaping mode: Tashkeel characters will be removed, buffer length will shrink.
* Shaping mode: Tashkeel characters will be removed, buffer length will shrink.
* De-shaping mode: N/A
* De-shaping mode: N/A
*
*
* Affects: Tashkeel options
* Affects: Tashkeel options
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int TASHKEEL_RESIZE = 0x80000;
public static final int TASHKEEL_RESIZE = 0x80000;
/**
/**
* Memory option: the result must have the same length as the source.
* Memory option: the result must have the same length as the source.
* Shaping mode: Tashkeel characters will be replaced by Tatweel if it is connected to adjacent
* Shaping mode: Tashkeel characters will be replaced by Tatweel if it is connected to adjacent
* characters (i.e. shaped on Tatweel) or replaced by space if it is not connected.
* characters (i.e. shaped on Tatweel) or replaced by space if it is not connected.
*
*
* De-shaping mode: N/A
* De-shaping mode: N/A
* Affects: YehHamza options
* Affects: YehHamza options
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int TASHKEEL_REPLACE_BY_TATWEEL = 0xC0000;
public static final int TASHKEEL_REPLACE_BY_TATWEEL = 0xC0000;
/** Bit mask for Tashkeel replacement with Space or Tatweel memory options.
/** Bit mask for Tashkeel replacement with Space or Tatweel memory options.
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int TASHKEEL_MASK = 0xE0000;
public static final int TASHKEEL_MASK = 0xE0000;
/* Space location Control options */
/* Space location Control options */
/**
/**
* This option effects the meaning of BEGIN and END options. if this option is not used the default
* This option effects the meaning of BEGIN and END options. if this option is not used the default
* for BEGIN and END will be as following:
* for BEGIN and END will be as following:
* The Default (for both Visual LTR, Visual RTL and Logical Text)
* The Default (for both Visual LTR, Visual RTL and Logical Text)
* 1. BEGIN always refers to the start address of physical memory.
* 1. BEGIN always refers to the start address of physical memory.
* 2. END always refers to the end address of physical memory.
* 2. END always refers to the end address of physical memory.
*
*
* If this option is used it will swap the meaning of BEGIN and END only for Visual LTR text.
* If this option is used it will swap the meaning of BEGIN and END only for Visual LTR text.
*
*
* The affect on BEGIN and END Memory Options will be as following:
* The affect on BEGIN and END Memory Options will be as following:
* A. BEGIN For Visual LTR text: This will be the beginning (right side) of the visual text
* A. BEGIN For Visual LTR text: This will be the beginning (right side) of the visual text
* (corresponding to the physical memory address end, same as END in default behavior)
* (corresponding to the physical memory address end, same as END in default behavior)
* B. BEGIN For Logical text: Same as BEGIN in default behavior.
* B. BEGIN For Logical text: Same as BEGIN in default behavior.
* C. END For Visual LTR text: This will be the end (left side) of the visual text. (corresponding to
* C. END For Visual LTR text: This will be the end (left side) of the visual text. (corresponding to
* the physical memory address beginning, same as BEGIN in default behavior)
* the physical memory address beginning, same as BEGIN in default behavior)
* D. END For Logical text: Same as END in default behavior.
* D. END For Logical text: Same as END in default behavior.
* Affects: All LamAlef BEGIN, END and AUTO options.
* Affects: All LamAlef BEGIN, END and AUTO options.
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int SPACES_RELATIVE_TO_TEXT_BEGIN_END = 0x4000000;
public static final int SPACES_RELATIVE_TO_TEXT_BEGIN_END = 0x4000000;
/** Bit mask for swapping BEGIN and END for Visual LTR text
/** Bit mask for swapping BEGIN and END for Visual LTR text
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int SPACES_RELATIVE_TO_TEXT_MASK = 0x4000000;
public static final int SPACES_RELATIVE_TO_TEXT_MASK = 0x4000000;
/**
/**
* If this option is used, shaping will use the new Unicode code point for TAIL (i.e. 0xFE73).
* If this option is used, shaping will use the new Unicode code point for TAIL (i.e. 0xFE73).
* If this option is not specified (Default), old unofficial Unicode TAIL code point is used (i.e. 0x200B)
* If this option is not specified (Default), old unofficial Unicode TAIL code point is used (i.e. 0x200B)
* De-shaping will not use this option as it will always search for both the new Unicode code point for the
* De-shaping will not use this option as it will always search for both the new Unicode code point for the
* TAIL (i.e. 0xFE73) or the old unofficial Unicode TAIL code point (i.e. 0x200B) and de-shape the
* TAIL (i.e. 0xFE73) or the old unofficial Unicode TAIL code point (i.e. 0x200B) and de-shape the
* Seen-Family letter accordingly.
* Seen-Family letter accordingly.
*
*
* Shaping Mode: Only shaping.
* Shaping Mode: Only shaping.
* De-shaping Mode: N/A.
* De-shaping Mode: N/A.
* Affects: All Seen options
* Affects: All Seen options
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int SHAPE_TAIL_NEW_UNICODE = 0x8000000;
public static final int SHAPE_TAIL_NEW_UNICODE = 0x8000000;
/** Bit mask for new Unicode Tail option
/** Bit mask for new Unicode Tail option
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int SHAPE_TAIL_TYPE_MASK = 0x8000000;
public static final int SHAPE_TAIL_TYPE_MASK = 0x8000000;
/**
/**
* Memory option: allow the result to have a different length than the source.
* Memory option: allow the result to have a different length than the source.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int LENGTH_GROW_SHRINK = 0;
public static final int LENGTH_GROW_SHRINK = 0;
/**
/**
* Memory option: allow the result to have a different length than the source.
* Memory option: allow the result to have a different length than the source.
* Affects: LamAlef options
* Affects: LamAlef options
* This option is an alias to LENGTH_GROW_SHRINK
* This option is an alias to LENGTH_GROW_SHRINK
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int LAMALEF_RESIZE = 0;
public static final int LAMALEF_RESIZE = 0;
/**
/**
* Memory option: the result must have the same length as the source.
* Memory option: the result must have the same length as the source.
* If more room is necessary, then try to consume spaces next to modified characters.
* If more room is necessary, then try to consume spaces next to modified characters.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int LENGTH_FIXED_SPACES_NEAR = 1;
public static final int LENGTH_FIXED_SPACES_NEAR = 1;
/**
/**
* Memory option: the result must have the same length as the source.
* Memory option: the result must have the same length as the source.
* If more room is necessary, then try to consume spaces next to modified characters.
* If more room is necessary, then try to consume spaces next to modified characters.
* Affects: LamAlef options
* Affects: LamAlef options
* This option is an alias to LENGTH_FIXED_SPACES_NEAR
* This option is an alias to LENGTH_FIXED_SPACES_NEAR
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int LAMALEF_NEAR = 1 ;
public static final int LAMALEF_NEAR = 1 ;
/**
/**
* Memory option: the result must have the same length as the source.
* Memory option: the result must have the same length as the source.
* If more room is necessary, then try to consume spaces at the end of the text.
* If more room is necessary, then try to consume spaces at the end of the text.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int LENGTH_FIXED_SPACES_AT_END = 2;
public static final int LENGTH_FIXED_SPACES_AT_END = 2;
/**
/**
* Memory option: the result must have the same length as the source.
* Memory option: the result must have the same length as the source.
* If more room is necessary, then try to consume spaces at the end of the text.
* If more room is necessary, then try to consume spaces at the end of the text.
* Affects: LamAlef options
* Affects: LamAlef options
* This option is an alias to LENGTH_FIXED_SPACES_AT_END
* This option is an alias to LENGTH_FIXED_SPACES_AT_END
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int LAMALEF_END = 2;
public static final int LAMALEF_END = 2;
/**
/**
* Memory option: the result must have the same length as the source.
* Memory option: the result must have the same length as the source.
* If more room is necessary, then try to consume spaces at the beginning of the text.
* If more room is necessary, then try to consume spaces at the beginning of the text.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int LENGTH_FIXED_SPACES_AT_BEGINNING = 3;
public static final int LENGTH_FIXED_SPACES_AT_BEGINNING = 3;
/**
/**
* Memory option: the result must have the same length as the source.
* Memory option: the result must have the same length as the source.
* If more room is necessary, then try to consume spaces at the beginning of the text.
* If more room is necessary, then try to consume spaces at the beginning of the text.
* Affects: LamAlef options
* Affects: LamAlef options
* This option is an alias to LENGTH_FIXED_SPACES_AT_BEGINNING
* This option is an alias to LENGTH_FIXED_SPACES_AT_BEGINNING
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int LAMALEF_BEGIN = 3;
public static final int LAMALEF_BEGIN = 3;
/**
/**
* Memory option: the result must have the same length as the source.
* Memory option: the result must have the same length as the source.
* Shaping Mode: For each LAMALEF character found, expand LAMALEF using space at end.
* Shaping Mode: For each LAMALEF character found, expand LAMALEF using space at end.
* If there is no space at end, use spaces at beginning of the buffer. If there
* If there is no space at end, use spaces at beginning of the buffer. If there
* is no space at beginning of the buffer, use spaces at the near (i.e. the space
* is no space at beginning of the buffer, use spaces at the near (i.e. the space
* after the LAMALEF character).
* after the LAMALEF character).
*
*
* Deshaping Mode: Perform the same function as the flag equals LAMALEF_END.
* Deshaping Mode: Perform the same function as the flag equals LAMALEF_END.
* Affects: LamAlef options
* Affects: LamAlef options
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int LAMALEF_AUTO = 0x10000;
public static final int LAMALEF_AUTO = 0x10000;
/**
/**
* Bit mask for memory options.
* Bit mask for memory options.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int LENGTH_MASK = 0x10003;
public static final int LENGTH_MASK = 0x10003;
/** Bit mask for LamAlef memory options.
/** Bit mask for LamAlef memory options.
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int LAMALEF_MASK = 0x10003;
public static final int LAMALEF_MASK = 0x10003;
/**
/**
* Direction indicator: the source is in logical (keyboard) order.
* Direction indicator: the source is in logical (keyboard) order.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int TEXT_DIRECTION_LOGICAL = 0;
public static final int TEXT_DIRECTION_LOGICAL = 0;
/**
/**
* Direction indicator:the source is in visual RTL order,
* Direction indicator:the source is in visual RTL order,
* the rightmost displayed character stored first.
* the rightmost displayed character stored first.
* This option is an alias to U_SHAPE_TEXT_DIRECTION_LOGICAL
* This option is an alias to U_SHAPE_TEXT_DIRECTION_LOGICAL
* @stable ICU 4.2
* @stable ICU 4.2
*/
*/
public static final int TEXT_DIRECTION_VISUAL_RTL = 0;
public static final int TEXT_DIRECTION_VISUAL_RTL = 0;
/**
/**
* Direction indicator: the source is in visual (display) order, that is,
* Direction indicator: the source is in visual (display) order, that is,
* the leftmost displayed character is stored first.
* the leftmost displayed character is stored first.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int TEXT_DIRECTION_VISUAL_LTR = 4;
public static final int TEXT_DIRECTION_VISUAL_LTR = 4;
/**
/**
* Bit mask for direction indicators.
* Bit mask for direction indicators.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int TEXT_DIRECTION_MASK = 4;
public static final int TEXT_DIRECTION_MASK = 4;
/**
/**
* Letter shaping option: do not perform letter shaping.
* Letter shaping option: do not perform letter shaping.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int LETTERS_NOOP = 0;
public static final int LETTERS_NOOP = 0;
/**
/**
* Letter shaping option: replace normative letter characters in the U+0600 (Arabic) block,
* Letter shaping option: replace normative letter characters in the U+0600 (Arabic) block,
* by shaped ones in the U+FE70 (Presentation Forms B) block. Performs Lam-Alef ligature
* by shaped ones in the U+FE70 (Presentation Forms B) block. Performs Lam-Alef ligature
* substitution.
* substitution.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int LETTERS_SHAPE = 8;
public static final int LETTERS_SHAPE = 8;
/**
/**
* Letter shaping option: replace shaped letter characters in the U+FE70 (Presentation Forms B) block
* Letter shaping option: replace shaped letter characters in the U+FE70 (Presentation Forms B) block
* by normative ones in the U+0600 (Arabic) block. Converts Lam-Alef ligatures to pairs of Lam and
* by normative ones in the U+0600 (Arabic) block. Converts Lam-Alef ligatures to pairs of Lam and
* Alef characters, consuming spaces if required.
* Alef characters, consuming spaces if required.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int LETTERS_UNSHAPE = 0x10;
public static final int LETTERS_UNSHAPE = 0x10;
/**
/**
* Letter shaping option: replace normative letter characters in the U+0600 (Arabic) block,
* Letter shaping option: replace normative letter characters in the U+0600 (Arabic) block,
* except for the TASHKEEL characters at U+064B...U+0652, by shaped ones in the U+Fe70
* except for the TASHKEEL characters at U+064B...U+0652, by shaped ones in the U+Fe70
* (Presentation Forms B) block. The TASHKEEL characters will always be converted to
* (Presentation Forms B) block. The TASHKEEL characters will always be converted to
* the isolated forms rather than to their correct shape.
* the isolated forms rather than to their correct shape.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int LETTERS_SHAPE_TASHKEEL_ISOLATED = 0x18;
public static final int LETTERS_SHAPE_TASHKEEL_ISOLATED = 0x18;
/**
/**
* Bit mask for letter shaping options.
* Bit mask for letter shaping options.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int LETTERS_MASK = 0x18;
public static final int LETTERS_MASK = 0x18;
/**
/**
* Digit shaping option: do not perform digit shaping.
* Digit shaping option: do not perform digit shaping.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int DIGITS_NOOP = 0;
public static final int DIGITS_NOOP = 0;
/**
/**
* Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits.
* Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int DIGITS_EN2AN = 0x20;
public static final int DIGITS_EN2AN = 0x20;
/**
/**
* Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039).
* Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039).
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int DIGITS_AN2EN = 0x40;
public static final int DIGITS_AN2EN = 0x40;
/**
/**
* Digit shaping option:
* Digit shaping option:
* Replace European digits (U+0030...U+0039) by Arabic-Indic digits
* Replace European digits (U+0030...U+0039) by Arabic-Indic digits
* if the most recent strongly directional character
* if the most recent strongly directional character
* is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
* is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
* The initial state at the start of the text is assumed to be not an Arabic,
* The initial state at the start of the text is assumed to be not an Arabic,
* letter, so European digits at the start of the text will not change.
* letter, so European digits at the start of the text will not change.
* Compare to DIGITS_ALEN2AN_INIT_AL.
* Compare to DIGITS_ALEN2AN_INIT_AL.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int DIGITS_EN2AN_INIT_LR = 0x60;
public static final int DIGITS_EN2AN_INIT_LR = 0x60;
/**
/**
* Digit shaping option:
* Digit shaping option:
* Replace European digits (U+0030...U+0039) by Arabic-Indic digits
* Replace European digits (U+0030...U+0039) by Arabic-Indic digits
* if the most recent strongly directional character
* if the most recent strongly directional character
* is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
* is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
* The initial state at the start of the text is assumed to be an Arabic,
* The initial state at the start of the text is assumed to be an Arabic,
* letter, so European digits at the start of the text will change.
* letter, so European digits at the start of the text will change.
* Compare to DIGITS_ALEN2AN_INT_LR.
* Compare to DIGITS_ALEN2AN_INT_LR.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int DIGITS_EN2AN_INIT_AL = 0x80;
public static final int DIGITS_EN2AN_INIT_AL = 0x80;
/** Not a valid option value. */
/** Not a valid option value. */
//private static final int DIGITS_RESERVED = 0xa0;
//private static final int DIGITS_RESERVED = 0xa0;
/**
/**
* Bit mask for digit shaping options.
* Bit mask for digit shaping options.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int DIGITS_MASK = 0xe0;
public static final int DIGITS_MASK = 0xe0;
/**
/**
* Digit type option: Use Arabic-Indic digits (U+0660...U+0669).
* Digit type option: Use Arabic-Indic digits (U+0660...U+0669).
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int DIGIT_TYPE_AN = 0;
public static final int DIGIT_TYPE_AN = 0;
/**
/**
* Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).
* Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int DIGIT_TYPE_AN_EXTENDED = 0x100;
public static final int DIGIT_TYPE_AN_EXTENDED = 0x100;
/**
/**
* Bit mask for digit type options.
* Bit mask for digit type options.
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
public static final int DIGIT_TYPE_MASK = 0x0100; // 0x3f00?
public static final int DIGIT_TYPE_MASK = 0x0100; // 0x3f00?
/**
/**
* some constants
* some constants
*/
*/
private static final char HAMZAFE_CHAR = '\ufe80';
private static final char HAMZAFE_CHAR = '\ufe80';
private static final char HAMZA06_CHAR = '\u0621';
private static final char HAMZA06_CHAR = '\u0621';
private static final char YEH_HAMZA_CHAR = '\u0626';
private static final char YEH_HAMZA_CHAR = '\u0626';
private static final char YEH_HAMZAFE_CHAR = '\uFE89';
private static final char YEH_HAMZAFE_CHAR = '\uFE89';
private static final char LAMALEF_SPACE_SUB = '\uffff';
private static final char LAMALEF_SPACE_SUB = '\uffff';
private static final char TASHKEEL_SPACE_SUB = '\ufffe';
private static final char TASHKEEL_SPACE_SUB = '\ufffe';
private static final char LAM_CHAR = '\u0644';
private static final char LAM_CHAR = '\u0644';
private static final char SPACE_CHAR = '\u0020';
private static final char SPACE_CHAR = '\u0020';
private static final char SHADDA_CHAR = '\uFE7C';
private static final char SHADDA_CHAR = '\uFE7C';
private static final char SHADDA06_CHAR = '\u0651';
private static final char SHADDA06_CHAR = '\u0651';
private static final char TATWEEL_CHAR = '\u0640';
private static final char TATWEEL_CHAR = '\u0640';
private static final char SHADDA_TATWEEL_CHAR = '\uFE7D';
private static final char SHADDA_TATWEEL_CHAR = '\uFE7D';
private static final char NEW_TAIL_CHAR = '\uFE73';
private static final char NEW_TAIL_CHAR = '\uFE73';
private static final char OLD_TAIL_CHAR = '\u200B';
private static final char OLD_TAIL_CHAR = '\u200B';
private static final int SHAPE_MODE = 0;
private static final int SHAPE_MODE = 0;
private static final int DESHAPE_MODE = 1;
private static final int DESHAPE_MODE = 1;
/**
/**
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
@Override
@Override
public boolean equals(Object rhs) {
public boolean equals(Object rhs) {
return rhs != null &&
return rhs != null &&
rhs.getClass() == ArabicShaping.class &&
rhs.getClass() == PersianShaping.class &&
options == ((ArabicShaping)rhs).options;
options == ((PersianShaping)rhs).options;
}
}
/**
/**
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
///CLOVER:OFF
///CLOVER:OFF
@Override
@Override
public int hashCode() {
public int hashCode() {
return options;
return options;
}
}
/**
/**
* @stable ICU 2.0
* @stable ICU 2.0
*/
*/
@Override
@Override
public String toString() {
public String toString() {
StringBuilder buf = new StringBuilder(super.toString());
StringBuilder buf = new StringBuilder(super.toString());
buf.append('[');
buf.append('[');
switch (options & LAMALEF_MASK) {
switch (options & LAMALEF_MASK) {
case LAMALEF_RESIZE: buf.append("LamAlef resize"); break;
case LAMALEF_RESIZE: buf.append("LamAlef resize"); break;
case LAMALEF_NEAR: buf.append("LamAlef spaces at near"); break;
case LAMALEF_NEAR: buf.append("LamAlef spaces at near"); break;
case LAMALEF_BEGIN: buf.append("LamAlef spaces at begin"); break;
case LAMALEF_BEGIN: buf.append("LamAlef spaces at begin"); break;
case LAMALEF_END: buf.append("LamAlef spaces at end"); break;
case LAMALEF_END: buf.append("LamAlef spaces at end"); break;
case LAMALEF_AUTO: buf.append("lamAlef auto"); break;
case LAMALEF_AUTO: buf.append("lamAlef auto"); break;
}
}
switch (options & TEXT_DIRECTION_MASK) {
switch (options & TEXT_DIRECTION_MASK) {
case TEXT_DIRECTION_LOGICAL: buf.append(", logical"); break;
case TEXT_DIRECTION_LOGICAL: buf.append(", logical"); break;
case TEXT_DIRECTION_VISUAL_LTR: buf.append(", visual"); break;
case TEXT_DIRECTION_VISUAL_LTR: buf.append(", visual"); break;
}
}
switch (options & LETTERS_MASK) {
switch (options & LETTERS_MASK) {
case LETTERS_NOOP: buf.append(", no letter shaping"); break;
case LETTERS_NOOP: buf.append(", no letter shaping"); break;
case LETTERS_SHAPE: buf.append(", shape letters"); break;
case LETTERS_SHAPE: buf.append(", shape letters"); break;
case LETTERS_SHAPE_TASHKEEL_ISOLATED: buf.append(", shape letters tashkeel isolated"); break;
case LETTERS_SHAPE_TASHKEEL_ISOLATED: buf.append(", shape letters tashkeel isolated"); break;
case LETTERS_UNSHAPE: buf.append(", unshape letters"); break;
case LETTERS_UNSHAPE: buf.append(", unshape letters"); break;
}
}
switch (options & SEEN_MASK) {
switch (options & SEEN_MASK) {
case SEEN_TWOCELL_NEAR: buf.append(", Seen at near"); break;
case SEEN_TWOCELL_NEAR: buf.append(", Seen at near"); break;
}
}
switch (options & YEHHAMZA_MASK) {
switch (options & YEHHAMZA_MASK) {
case YEHHAMZA_TWOCELL_NEAR: buf.append(", Yeh Hamza at near"); break;
case YEHHAMZA_TWOCELL_NEAR: buf.append(", Yeh Hamza at near"); break;
}
}
switch (options & TASHKEEL_MASK) {
switch (options & TASHKEEL_MASK) {
case TASHKEEL_BEGIN: buf.append(", Tashkeel at begin"); break;
case TASHKEEL_BEGIN: buf.append(", Tashkeel at begin"); break;
case TASHKEEL_END: buf.append(", Tashkeel at end"); break;
case TASHKEEL_END: buf.append(", Tashkeel at end"); break;
case TASHKEEL_REPLACE_BY_TATWEEL: buf.append(", Tashkeel replace with tatweel"); break;
case TASHKEEL_REPLACE_BY_TATWEEL: buf.append(", Tashkeel replace with tatweel"); break;
case TASHKEEL_RESIZE: buf.append(", Tashkeel resize"); break;
case TASHKEEL_RESIZE: buf.append(", Tashkeel resize"); break;
}
}
switch (options & DIGITS_MASK) {
switch (options & DIGITS_MASK) {
case DIGITS_NOOP: buf.append(", no digit shaping"); break;
case DIGITS_NOOP: buf.append(", no digit shaping"); break;
case DIGITS_EN2AN: buf.append(", shape digits to AN"); break;
case DIGITS_EN2AN: buf.append(", shape digits to AN"); break;
case DIGITS_AN2EN: buf.append(", shape digits to EN"); break;
case DIGITS_AN2EN: buf.append(", shape digits to EN"); break;
case DIGITS_EN2AN_INIT_LR: buf.append(", shape digits to AN contextually: default EN"); break;
case DIGITS_EN2AN_INIT_LR: buf.append(", shape digits to AN contextually: default EN"); break;
case DIGITS_EN2AN_INIT_AL: buf.append(", shape digits to AN contextually: default AL"); break;
case DIGITS_EN2AN_INIT_AL: buf.append(", shape digits to AN contextually: default AL"); break;
}
}
switch (options & DIGIT_TYPE_MASK) {
switch (options & DIGIT_TYPE_MASK) {
case DIGIT_TYPE_AN: buf.append(", standard Arabic-Indic digits"); break;
case DIGIT_TYPE_AN: buf.append(", standard Arabic-Indic digits"); break;
case DIGIT_TYPE_AN_EXTENDED: buf.append(", extended Arabic-Indic digits"); break;
case DIGIT_TYPE_AN_EXTENDED: buf.append(", extended Arabic-Indic digits"); break;
}
}
buf.append("]");
buf.append("]");
return buf.toString();
return buf.toString();
}
}
///CLOVER:ON
///CLOVER:ON
//
//
// ported api
// ported api
//
//
private static final int IRRELEVANT = 4;
private static final int IRRELEVANT = 4;
private static final int LAMTYPE = 16;
private static final int LAMTYPE = 16;
private static final int ALEFTYPE = 32;
private static final int ALEFTYPE = 32;
private static final int LINKR = 1;
private static final int LINKR = 1;
private static final int LINKL = 2;
private static final int LINKL = 2;
private static final int LINK_MASK = 3;
private static final int LINK_MASK = 3;
private static final int irrelevantPos[] = {
private static final int irrelevantPos[] = {
0x0, 0x2, 0x4, 0x6, 0x8, 0xA, 0xC, 0xE
0x0, 0x2, 0x4, 0x6, 0x8, 0xA, 0xC, 0xE
};
};
/*
/*
private static final char convertLamAlef[] = {
private static final char convertLamAlef[] = {
'\u0622', // FEF5
'\u0622', // FEF5
'\u0622', // FEF6
'\u0622', // FEF6
'\u0623', // FEF7
'\u0623', // FEF7
'\u0623', // FEF8
'\u0623', // FEF8
'\u0625', // FEF9
'\u0625', // FEF9
'\u0625', // FEFA
'\u0625', // FEFA
'\u0627', // FEFB
'\u0627', // FEFB
'\u0627' // FEFC
'\u0627' // FEFC
};
};
*/
*/
private static final int tailFamilyIsolatedFinal[] = {
private static final int tailFamilyIsolatedFinal[] = {
/* FEB1 */ 1,
/* FEB1 */ 1,
/* FEB2 */ 1,
/* FEB2 */ 1,
/* FEB3 */ 0,
/* FEB3 */ 0,
/* FEB4 */ 0,
/* FEB4 */ 0,
/* FEB5 */ 1,
/* FEB5 */ 1,
/* FEB6 */ 1,
/* FEB6 */ 1,
/* FEB7 */ 0,
/* FEB7 */ 0,
/* FEB8 */ 0,
/* FEB8 */ 0,
/* FEB9 */ 1,
/* FEB9 */ 1,
/* FEBA */ 1,
/* FEBA */ 1,
/* FEBB */ 0,
/* FEBB */ 0,
/* FEBC */ 0,
/* FEBC */ 0,
/* FEBD */ 1,
/* FEBD */ 1,
/* FEBE */ 1
/* FEBE */ 1
};
};
private static final int tashkeelMedial[] = {
private static final int tashkeelMedial[] = {
/* FE70 */ 0,
/* FE70 */ 0,
/* FE71 */ 1,
/* FE71 */ 1,
/* FE72 */ 0,
/* FE72 */ 0,
/* FE73 */ 0,
/* FE73 */ 0,
/* FE74 */ 0,
/* FE74 */ 0,
/* FE75 */ 0,
/* FE75 */ 0,
/* FE76 */ 0,
/* FE76 */ 0,
/* FE77 */ 1,
/* FE77 */ 1,
/* FE78 */ 0,
/* FE78 */ 0,
/* FE79 */ 1,
/* FE79 */ 1,
/* FE7A */ 0,
/* FE7A */ 0,
/* FE7B */ 1,
/* FE7B */ 1,
/* FE7C */ 0,
/* FE7C */ 0,
/* FE7D */ 1,
/* FE7D */ 1,
/* FE7E */ 0,
/*
/* FE7F */ 1
};
private static final char yehHamzaToYeh[] =
{
/* isolated*/ 0xFEEF,
/* final */ 0x