Text In Wild Wrapper Library

by Voodoo Editor
2 years ago
465 Views

Table of Contents


Voodoo: Text In The Wild Packaged Library

Voodoo RPA EDEnvrionment allows the user to develop and integrate anything into robotic process automation projects. Voodoo: Text In The Wild can be used in the EDE environment and by using Voodoo’s Optical Character Recognition system on Pictures, it separates the texts from the pictures and allows these texts to be used at the desired points of the processes within the process automation. Below are the Property classes, methods and example usages of the Voodoo: Text In The Wild Library.

TiwSample

You can add TIW-Loader library to Voodoo File References in EDE.

#Text In The Wild: TIWResponse Property


    public class TIWResponse
    {
        public string SourceFilePath { get; set; } // Source File Path Property
        public int Operation { get; set; } // User determines Operation Number which is referenced with which operation will be processed
        public int RetCode { get; set; } // This is the Return Code which is shown to user from Server/Service
        public string DetailedInfo { get; set; } // Detailed Information
        public int UsageLeft { get; set; } // Restricted Usage Counter
        public IList LstTextResult { get; set; } // TIW Returns the Result in List
    }


#Text In The Wild: LstTextResult Property


    public class LstTextResult
    {
        public int RetCode { get; set; } // Return Code From Server/Service
        public string Value { get; set; } // Returned Value From TIWService
        public float ValueProbability { get; set; } // This is the percentage which is shows the value is the wanted value

        //Image Coordinates

        public int bl_x { get; set; }
        public int bl_y { get; set; }
        public int tl_x { get; set; }
        public int tl_y { get; set; }
        public int br_x { get; set; }
        public int br_y { get; set; }
        public int tr_x { get; set; }
        public int tr_y { get; set; }
    }



#Text In The Wild: Available Methods


    public TIWResponse digitizeDoc(string imagePath, string endPoint)

    public int LDCompute(string s, string t)


#Example1: Import Extracted Text Field From Images to Data Source

LstTextResult Method


using TIWLoader; //Add .dll to Code References
using System.Data;
using System.Linq;

string endPoint = ""; //TIW Services End Point etc: http://endpoint.com:portno/recognize 
TIW TIWObj = new TIW();
TIWResponse TIWResponseObj = TIWObj.digitizeDoc(@"C:\inetpub\wwwroot\tiwpage\test1.jpg", endPoint);

if (TIWResponseObj.LstTextResult.Count() > 0)
{
    foreach (LstTextResult LstTextResultObj in TIWResponseObj.LstTextResult)
    {
        if (LstTextResultObj.Value != "")
        {
            DataRow dr = planDataInstanceManager_.GetNewRow(10);
            dr["words"] = LstTextResultObj.Value;
            planDataInstanceManager_.AddRowToDataTable(10, dr);

        }
    }
}

result_ = true;

#Example2: Differences Between Texts

LDCompute Method


    int distance = TIWObj.LDCompute(LstTextList[0].Value, "thisismytext");

Note: Distance “0” Means texts are same. For example; “3” Means there are three characters differences between texts.