> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Recognizing Handprinted Arabic Digits

ABBYY FineReader Engine does not currently support Arabic ICR. However, recognizing specifically Arabic digits is possible, and this article describes the necessary steps.

In addition to the procedure outlined in [Recognizing Handwritten Texts](/fine-reader/engine/guided-tour/advanced-techniques/recognizing-handwritten-texts), for Arabic digits recognition, you need to create a custom language with the alphabet consisting only of 10 digit symbols and set it as the recognition language for every block with digits.

Therefore, to recognize Arabic handprinted digits do the following:

1. Create a new text language using the [CreateTextLanguage](/fine-reader/engine/api-reference/language-related-objects/languagedatabase/createtextlanguage-method) method of the [LanguageDatabase](/fine-reader/engine/api-reference/language-related-objects/languagedatabase) object.
2. Using the [LetterSet](/fine-reader/engine/api-reference/language-related-objects/baselanguage/letterset-property) property of the [BaseLanguage](/fine-reader/engine/api-reference/language-related-objects/baselanguage) object within the TextLanguage object, set the language alphabet containing the following characters: ٠١٢٣٤٥٦٧٨٩.
3. For each block containing handprinted Arabic digits specify recognition parameters via the [ITextBlock::RecognizerParams](/fine-reader/engine/api-reference/layout-related-objects/textblock#recognizerparams) property:
   * Set the [TextLanguage](/fine-reader/engine/api-reference/parameter-objects/preprocessing-analysis-recognition-and-synthesis-parameters/recognizerparams#textlanguage) property of the [RecognizerParams](/fine-reader/engine/api-reference/parameter-objects/preprocessing-analysis-recognition-and-synthesis-parameters/recognizerparams) object to the language you created in the previous step.
   * Set the [TextTypes](/fine-reader/engine/api-reference/parameter-objects/preprocessing-analysis-recognition-and-synthesis-parameters/recognizerparams#texttypes) property of the RecognizerParams object to TT\_Handwritten.
   * If the digits are enclosed in a frame, box, etc., set up the type of marking around the letters in the [FieldMarkingType](/fine-reader/engine/api-reference/parameter-objects/preprocessing-analysis-recognition-and-synthesis-parameters/recognizerparams#fieldmarkingtype) property of the RecognizerParams object. If each digit is written in a separate cell, use also the [CellsCount](/fine-reader/engine/api-reference/parameter-objects/preprocessing-analysis-recognition-and-synthesis-parameters/recognizerparams#cellscount) property to set up the number of character cells in the block.

## Windows Samples

<Accordion title="C++ (COM) code">
  ```cpp theme={null}
  // Global ABBYY FineReader Engine object
  FREngine::IEnginePtr Engine;
  ...
  // Open an image file
  ...
  // Create a custom language
  FREngine::ILanguageDatabasePtr pLanguageDatabase = Engine->CreateLanguageDatabase();
  FREngine::ITextLanguagePtr pTextLanguage = pLanguageDatabase->CreateTextLanguage();
  FREngine::IBaseLanguagesPtr pBaseLanguages = pTextLanguage->BaseLanguages;
  FREngine::IBaseLanguagePtr pBaseLanguage = pBaseLanguages->AddNew();
  // Set the alphabet
  pBaseLanguage->put_LetterSet( FREngine::BLLS_Alphabet, L"٠١٢٣٤٥٦٧٨٩" );
  // Obtain the Layout object from the page
  FREngine::ILayoutPtr layout = frPage->get_Layout();
  // Set block region
  FREngine::IRegionPtr pRegion = Engine->CreateRegion();
  pRegion->AddRect( 491, 314, 2268, 404 );
  // Create a new block
  FREngine::IBlockPtr newBlock = layout->Blocks->AddNew( FREngine::BT_Text, pRegion, 0 );
  FREngine::ITextBlockPtr textBlock = newBlock->GetAsTextBlock();
  // Set the custom language
  textBlock->RecognizerParams->TextLanguage = pTextLanguage;
  // Specify the text type
  textBlock->RecognizerParams->TextTypes = FREngine::TT_Handwritten;
  // Specify the type of marking around the letters
  textBlock->RecognizerParams->FieldMarkingType = FREngine::FMT_SimpleText;
  // Recognition and export
  ...
  ```
</Accordion>

<Accordion title="C# code">
  ```csharp theme={null}
  // Global ABBYY FineReader Engine object
  FREngine.IEngine engine;
  ...
  // Open an image file
  ...
  // Create a custom language
  FREngine.ILanguageDatabase languageDatabase = engine.CreateLanguageDatabase();
  FREngine.ITextLanguage textLanguage = languageDatabase.CreateTextLanguage();
  FREngine.IBaseLanguages baseLanguages = textLanguage.BaseLanguages;
  FREngine.IBaseLanguage baseLanguage = baseLanguages.AddNew();
  // Set the alphabet
  baseLanguage.set_LetterSet( FREngine.BaseLanguageLetterSetEnum.BLLS_Alphabet, "٠١٢٣٤٥٦٧٨٩" );
  // Obtain the Layout object from the page
  FREngine.ILayout layout = frPage.Layout;
  // Set block region
  FREngine.IRegion region = engine.CreateRegion();
  region.AddRect( 491, 314, 2268, 404 );
  // Create a new block
  FREngine.IBlock newBlock = layout.Blocks.AddNew( FREngine.BlockTypeEnum.BT_Text, region, 0 );
  FREngine.ITextBlock textBlock = newBlock.GetAsTextBlock();
  // Set the custom language
  textBlock.RecognizerParams.TextLanguage = textLanguage;
  // Specify the text type
  textBlock.RecognizerParams.TextTypes = (int)FREngine.TextTypeEnum.TT_Handwritten;
  // Specify the type of marking around the letters
  textBlock.RecognizerParams.FieldMarkingType = FREngine.FieldMarkingTypeEnum.FMT_SimpleText;
  // Recognition and export
  ...
  ```
</Accordion>

## See also

[RecognizerParams](/fine-reader/engine/api-reference/parameter-objects/preprocessing-analysis-recognition-and-synthesis-parameters/recognizerparams)

[Recognizing Handwritten Texts](/fine-reader/engine/guided-tour/advanced-techniques/recognizing-handwritten-texts)

[Working with Languages](/fine-reader/engine/guided-tour/advanced-techniques/working-with-languages)
