Alphabet_v1

Download script

This script serves as a diagnostic and verification tool designed to test how the system identifies and categorizes different types of characters. Essentially, it acts as a "lookup test" to ensure that the underlying logic for recognizing text—such as letters, numbers, and symbols—is functioning correctly.

Core Logic Overview

The script performs three primary actions to validate the character recognition engine:

1. Data Integrity Check At the beginning of the process, the script systematically goes through various pre-defined lists of characters. It prints out multiple categories of data to the terminal, including:

  • Russian Characters: Both uppercase and lowercase variations.
  • Latin (English) Characters: Both uppercase and lowercase variations.
  • Digits: Standard numerical figures.
  • Punctuation & Symbols: Various marks and signs.
  • Formatting Marks: Specific items like whitespace, "wrap" markers, and brackets.

By displaying these in the report, the user can verify that the system recognizes every expected character in the correct language or category.

2. Dynamic Character Testing The script then moves into an active testing phase where it takes a small sample of diverse inputs—specifically a blank space, a parenthesis, a number, a currency symbol, and a sequence of letters.

For each item in this sample:

  • It feeds the character into the "Check" function.
  • The system determines which category that character belongs to (e.g., identifying that "7" is a Digit or "$" is Punctuation).
  • It outputs a clear label showing the input and its identified category.

3. Short-Code Validation Finally, the script performs a targeted check on specific technical shorthand symbols (like spaces, commas, and left brackets). It verifies that these specific "short" versions of characters are correctly categorized by the logic engine.

Summary for the User

Think of this script as a calibration test. It doesn't perform trading actions or execute complex calculations; instead, it confirms that the system's "dictionary" is accurate. If the script runs and correctly labels a letter as a letter and a number as a number, you can be confident that any other text-based logic using this tool will behave predictably.

5 Views
1 Downloads
0 Favorites
Alphabet_v1
ÿþ/**/

#include "Alphabet.mqh"

/****************************************************************/

void OnStart()

  {

   Alphabet abc;

   /*REPORT*/

   Print("RUSSIAN");

   ArrayPrint(abc.russian.capital.shortitems);

   ArrayPrint(abc.russian.capital.stringitems);

   ArrayPrint(abc.russian.lowercase.shortitems);

   ArrayPrint(abc.russian.lowercase.stringitems);

   Print("LATIN");

   ArrayPrint(abc.latin.capital.shortitems);

   ArrayPrint(abc.latin.capital.stringitems);

   ArrayPrint(abc.latin.lowercase.shortitems);

   ArrayPrint(abc.latin.lowercase.stringitems);

   Print("DIGITS");

   ArrayPrint(abc.digits.shortitems);

   ArrayPrint(abc.digits.stringitems);

   Print("PUNCTUATION");

   ArrayPrint(abc.punctuations.shortitems);

   ArrayPrint(abc.punctuations.stringitems);

   Print("NO SPACE BEFORE");

   ArrayPrint(abc.nospacebefores.shortitems);

   ArrayPrint(abc.nospacebefores.stringitems);

   Print("NO SPACE AFTER");

   ArrayPrint(abc.nospaceafters.shortitems);

   ArrayPrint(abc.nospaceafters.stringitems);

   Print("WRAP");

   ArrayPrint(abc.wrapmarkers.shortitems);

   ArrayPrint(abc.wrapmarkers.stringitems);

   Print("WHITESPACE");

   ArrayPrint(abc.whitespaces.shortitems);

   ArrayPrint(abc.whitespaces.stringitems);

   Print("BRACKETS");

   ArrayPrint(abc.brackets.shortitems);

   ArrayPrint(abc.brackets.stringitems);

   Print("CHECK");

   ENUM_ALPHABET_CAT category;

   /**/

   string stringchars[]= {"\\","(","7","$","abc"};

   int sizestringchars=ArraySize(stringchars);

   for(int i=0; i<sizestringchars; i++)

     {

      string stringchar=stringchars[i];

      category=abc.Check(stringchar);

      Print(stringchar," is ",EnumToString(category));

     }

   /**/

   for(int i=0; i<3; i++)

     {

      short shortchar=(i==0)?abc.space.shortitem:

                      (i==1)?abc.comma.shortitem:

                      abc.leftbrace.shortitem;

      category=abc.Check(shortchar);

      Print(shortchar," is a ",EnumToString(category));

     }

   /**/

   return;

  }

/**/

Comments