Exemple #1
0
 public TSubject() : base("T_SUBJECT")
 {
     Add(valueField = new TInt("F_SUBJECT", () => subject, x => subject = x));
     Add(groupField = new TChar("F_TYPE", () => type, x => type = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
     Add(new TString("F_ALIAS", () => alias, x => alias = x));
 }
Exemple #2
0
 public TType() : base("T_TYPE")
 {
     Add(valueField = new TChar("F_TYPE", () => type, x => type = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
     Add(new TString("F_ALIAS", () => alias, x => alias = x));
     Add(new TInt("F_ECODE", () => ecode, x => ecode    = x));
 }
Exemple #3
0
 public TConnectKind() : base("T_CONNECT_KIND")
 {
     Add(valueField = new TChar("F_CONNECT_KIND", () => connectKind, x => connectKind = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
     Add(new TInt("F_XFER", () => xfer, x => xfer       = x));
     Add(new TString("F_ALIAS", () => alias, x => alias = x));
 }
Exemple #4
0
 public TSubpoenaKind() : base("T_SUBPOENA_KIND")
 {
     Add(valueField = new TChar("F_SUBPOENA_KIND", () => subpoenaKind, x => subpoenaKind = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
     Add(new TString("F_ALIAS", () => alias, x => alias = x));
     Add(new TChar("F_GENERIC_KIND", () => genericKind, x => genericKind = x));
     Add(new TString("F_INFO", () => info, x => info = x));
 }
Exemple #5
0
 public TConnectType() : base("T_CONNECT_TYPE")
 {
     Add(valueField = new TChar("F_CONNECT_TYPE", () => connectType, x => connectType = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
     Add(new TString("F_ALIAS", () => alias, x => alias = x));
     Add(new TString("F_CONNECT_KINDS", () => connectKinds, x => connectKinds = x));
     Add(new TChar("F_SENDER_TYPE", () => senderType, x => senderType         = x));
     Add(new TInt("F_XFER", () => xfer, x => xfer    = x));
     Add(new TInt("F_EISPP", () => eispp, x => eispp = x));
 }
Exemple #6
0
 public TKind() : base("T_KIND")
 {
     Add(valueField = new TChar("F_KIND", () => kind, x => kind = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
     Add(new TChar("F_TYPE", () => type, x => type      = x));
     Add(new TString("F_ALIAS", () => alias, x => alias = x));
     Add(new TInt("F_XFER", () => xfer, x => xfer       = x));
     Add(new TInt("F_EISPP", () => eispp, x => eispp    = x));
     Add(new TInt("F_WHAT", () => what, x => what       = x));
 }
Exemple #7
0
 public TReceivedStatus() : base("T_RECEIVED_STATUS")
 {
     Add(valueField = new TChar("F_RECEIVED_STATUS", () => receivedStatus, x => receivedStatus = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
     Add(new TString("F_ALIAS", () => alias, x => alias           = x));
     Add(new TChar("F_CLERK", () => clerk, x => clerk             = x));
     Add(new TChar("F_DELIVERER", () => deliverer, x => deliverer = x));
     Add(new TChar("F_ALLOW_DATE_RECEIVED", () => allowDateReceived, x => allowDateReceived = x));
     Add(new TChar("F_ALLOW_DATE_RETURNED", () => allowDateReturned, x => allowDateReturned = x));
     Add(new TChar("F_ALLOW_SCHEDULE", () => allowSchedule, x => allowSchedule           = x));
     Add(new TChar("F_SHOW_SUBPOENA_DATE", () => showSubpoenaDate, x => showSubpoenaDate = x));
 }
Exemple #8
0
        public static TChar[] StringToSByteArray(string text)
        {
            if (string.IsNullOrEmpty(text))
            {
                return(new TChar[0]);
            }

            TChar[] result = new TChar[text.Length];
            for (int charIndex = 0; charIndex < text.Length; charIndex++)
            {
                result[charIndex] = (TChar)text[charIndex];
            }

            return(result);
        }
Exemple #9
0
 /// <summary>
 /// Sets the next character.
 /// </summary>
 /// <param name="cCharData">The c character data.</param>
 /// <param name="iConfidence">The i confidence.</param>
 /// <param name="iLeft">The i left.</param>
 /// <param name="iTop">The i top.</param>
 /// <param name="iWidth">Width of the i.</param>
 /// <param name="iHeight">Height of the i.</param>
 /// <param name="iLine">The i line.</param>
 /// <param name="iWord">The i word.</param>
 public void SetNextChar(char cCharData, short iConfidence, int iLeft, int iTop, int iWidth, int iHeight, int iLine, int iWord)
 {
     if ((cCharData == ' '))
     {
         m_oSetLine.AddWord(m_oSetWord);
         m_oSetWord = new TWord();
     }
     else if (cCharData == '\n')
     {
         m_oPage.AddLine(m_oSetLine);
         m_oSetLine = new TLine();
     }
     else
     {
         TChar oSetChar = new TChar(cCharData, iConfidence, new TOCRRect(iLeft, iTop, iWidth, iHeight));
         m_oSetWord.AddChar(oSetChar);
     }
 }
        public void CharAtPointTest()
        {
            TPage page = m_TestPage;

            DataLocator target = new DataLocator(page);

            Point point = new Point();

            TChar expected = null;
            TChar actual;

            actual = target.CharAtPoint(point);

            Assert.AreEqual(expected, actual, "Recognition.Locator.DataLocator.CharAtPoint did not return the expected value.");

            point    = new Point(325, 285);
            expected = page.Lines[0].Words[0].Chars[0];

            actual = target.CharAtPoint(point);

            Assert.AreEqual(expected, actual, "Recognition.Locator.DataLocator.HasLineAtPoint did not return the expected value." +
                            "");
        }
Exemple #11
0
 public Node this[TChar key]
 {
     get => _childs[key];
Exemple #12
0
 public bool Contains(TChar item)
 {
     return(_childs.ContainsKey(item));
 }
Exemple #13
0
 public Node(Node parent, TChar value, IEqualityComparer <TChar> comparer)
 {
     Value   = value;
     _childs = new Dictionary <TChar, Node>(ChildsCapacity, comparer);
     Parent  = parent;
 }
Exemple #14
0
        public static RichTextBox LoadMSDInTexEditorForm(RichTextBox texbox, MSDEntry msde)
        {
            texbox.Text = "";


            //Fills in the entries using a hopefully more efficient method based on what I see from Anotak and co's MSD Editor from a few years back.
            using (MemoryStream mstream = new MemoryStream(msde.UncompressedData))
            {
                using (BinaryReader bnr = new BinaryReader(mstream))
                {
                    bnr.BaseStream.Position = 8;
                    msde.EntryList          = new List <MessageEntries>();
                    StringBuilder SBuild = new StringBuilder();
                    msde.TextBackup = new List <string>(msde.EntryCount);
                    //Encoding ShouldBeShiftJIS = Encoding.GetEncoding(932);
                    //string Atr = "";
                    //string AtrB = "";
                    byte[] TestArray = new byte[2];
                    int    BPTest    = 0;
                    int    ITChar    = 0;

                    while (bnr.BaseStream.Position < bnr.BaseStream.Length)
                    {
                        MessageEntries me = new MessageEntries();
                        me.MSLength = bnr.ReadInt16();
                        SBuild.Clear();

                        for (int i = 0; i < me.MSLength; i++)
                        {
                            BPTest = Convert.ToInt32(bnr.BaseStream.Position);
                            ITChar = bnr.ReadInt16();
                            string TChar;
                            if (ITChar == -2)
                            {
                                TChar = "[line break]";
                            }
                            else
                            {
                                TChar = ITChar.ToString("X4");

                                try
                                {
                                    using (var sr = new StreamReader("MSDTable.cfg"))
                                    {
                                        while (!sr.EndOfStream)
                                        {
                                            var keyword = Console.ReadLine() ?? TChar;
                                            var line    = sr.ReadLine();
                                            if (String.IsNullOrEmpty(line))
                                            {
                                                continue;
                                            }
                                            if (line.IndexOf(keyword, StringComparison.CurrentCultureIgnoreCase) >= 0)
                                            {
                                                TChar = line;
                                                TChar = TChar.Split(' ')[1];
                                                break;
                                            }
                                        }
                                    }
                                }
                                catch (FileNotFoundException)
                                {
                                    MessageBox.Show("I cannot find archive_filetypes.cfg so I cannot finish parsing the arc.", "Oh Boy");
                                    using (StreamWriter sw = File.AppendText("Log.txt"))
                                    {
                                        sw.WriteLine("Cannot find archive_filetypes.cfg so I cannot continue parsing the file.");
                                    }
                                }
                                if (TChar == "")
                                {
                                    TChar = " ";
                                }
                            }
                            SBuild.Append(TChar);
                        }
                        me.contents = SBuild.ToString();
                        msde.TextBackup.Add((me.contents));
                        texbox.Text = texbox.Text + me.contents + "\n";
                        short termchar = bnr.ReadInt16();
                        if (termchar != -1)
                        {
                        }

                        msde.EntryList.Add(me);
                    }
                }
            }

            return(texbox);
        }
 public Transition(TChar @char, FsmState fsmState)
 {
     this.Char     = @char;
     this.FsmState = fsmState;
 }
Exemple #16
0
 public TUCNType() : base("T_UCN_TYPE")
 {
     Add(valueField = new TChar("F_UCN_TYPE", () => ucnType, x => ucnType = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
     Add(new TChar("F_UXN_TYPE", () => uxnType, x => uxnType = x));
 }
Exemple #17
0
 protected TBaseComposition() : base("T_COMPOSITION")
 {
     Add(valueField = new TInt("F_COMPOSITION", () => composition, x => composition = x));
     Add(groupField = new TChar("F_COLLEGE", () => college, x => college = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="OCRCharResult"/> class.
 /// </summary>
 /// <param name="oChar">The o character.</param>
 public OCRCharResult(TChar oChar)
 {
     m_oChar = oChar;
 }
Exemple #19
0
 public TResult() : base("T_RESULT")
 {
     Add(valueField = new TChar("F_RESULT", () => result, x => result = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
     Add(new TInt("F_XFER", () => xfer, x => xfer = x));
 }
Exemple #20
0
        /// <summary>
        /// Gets the character.
        /// </summary>
        /// <param name="iCharIndex">Index of the i character.</param>
        /// <returns></returns>
        public IChar GetChar(int iCharIndex)
        {
            TChar oChar = (TChar)m_oWord.Chars[iCharIndex];

            return(new OCRCharResult(oChar));
        }
Exemple #21
0
 public TPost() : base("T_POST")
 {
     Add(valueField = new TChar("F_POST", () => post, x => post = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
 }
Exemple #22
0
 public TCollege() : base("T_COLLEGE")
 {
     Add(valueField = new TChar("F_COLLEGE", () => college, x => college = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
 }
Exemple #23
0
 public TInvolvement() : base("T_INVOLVEMENT")
 {
     Add(valueField = new TChar("F_INVOLVEMENT", () => involvement, x => involvement = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
     Add(new TInt("F_XFER", () => xfer, x => xfer = x));
 }
Exemple #24
0
 public TResolution() : base("T_RESOLUTION")
 {
     Add(valueField = new TChar("F_RESOLUTION", () => resolution, x => resolution = x));
     Add(nameField  = new TString("F_NAME", () => name, x => name = x));
 }
        /// <summary>
        /// Receives 2 prd pages and return if they are equal or not.
        /// </summary>
        private bool ComparePrdPages(TPage prdPage1, TPage prdPage2)
        {
            long charCounter = 0;

            if (prdPage1.Confidance != prdPage2.Confidance)
            {
                return(false);
            }

            if (prdPage1.NoOfLines != prdPage2.NoOfLines)
            {
                return(false);
            }

            Rectangle page1Rectangle = prdPage1.Rectangle;
            Rectangle page2Rectangle = prdPage2.Rectangle;

            if (page1Rectangle.Top != page2Rectangle.Top)
            {
                return(false);
            }

            if (page1Rectangle.Bottom != page2Rectangle.Bottom)
            {
                return(false);
            }

            if (page1Rectangle.Left != page2Rectangle.Left)
            {
                return(false);
            }

            if (page1Rectangle.Right != page2Rectangle.Right)
            {
                return(false);
            }

            TOCRRect page1OcrRectangle = new TOCRRect(page1Rectangle.Left, page1Rectangle.Top, page1Rectangle.Width, page1Rectangle.Height);
            TOCRRect page2OcrRectangle = new TOCRRect(page2Rectangle.Left, page2Rectangle.Top, page2Rectangle.Width, page2Rectangle.Height);

            if (prdPage1.Deskew(page1OcrRectangle).Top != prdPage1.Deskew(page2OcrRectangle).Top)
            {
                return(false);
            }

            if (prdPage1.Deskew(page1OcrRectangle).Bottom != prdPage1.Deskew(page2OcrRectangle).Bottom)
            {
                return(false);
            }

            if (prdPage1.Deskew(page1OcrRectangle).Left != prdPage1.Deskew(page2OcrRectangle).Left)
            {
                return(false);
            }

            if (prdPage1.Deskew(page1OcrRectangle).Right != prdPage1.Deskew(page2OcrRectangle).Right)
            {
                return(false);
            }

            if (prdPage1.MMtoPixel(100) != prdPage2.MMtoPixel(100))
            {
                return(false);
            }

            IList <TLine> prdLines = prdPage1.Lines;

            // Lines check.
            for (int i = 0; i < prdLines.Count; i++)
            {
                TLine prdLine1 = prdPage1.Lines[i];
                TLine prdLine2 = prdPage2.Lines[i];

                if (prdLine1.Rectangle.Top != prdLine2.Rectangle.Top)
                {
                    return(false);
                }

                if (prdLine1.Rectangle.Bottom != prdLine2.Rectangle.Bottom)
                {
                    return(false);
                }

                if (prdLine1.Rectangle.Left != prdLine2.Rectangle.Left)
                {
                    return(false);
                }

                if (prdLine1.Rectangle.Right != prdLine2.Rectangle.Right)
                {
                    return(false);
                }

                // Check words in line.
                for (int j = 0; j < prdLine1.Words.Count; j++)
                {
                    TWord prdWord1 = prdLine1.Words[j];
                    TWord prdWord2 = prdLine2.Words[j];

                    if (prdWord1.Confidance != prdWord2.Confidance)
                    {
                        return(false);
                    }

                    if (prdWord1.Style != prdWord2.Style)
                    {
                        return(false);
                    }

                    // Check characters in word.
                    for (int z = 0; z < prdWord1.Chars.Count; z++)
                    {
                        TChar prdChar1 = prdWord1.Chars[z];
                        TChar prdChar2 = prdWord2.Chars[z];

                        if (prdChar1.Rect.Top != prdChar2.Rect.Top)
                        {
                            return(false);
                        }

                        if (prdChar1.Rect.Bottom != prdChar2.Rect.Bottom)
                        {
                            return(false);
                        }

                        if (prdChar1.Rect.Left != prdChar2.Rect.Left)
                        {
                            return(false);
                        }

                        if (prdChar1.Rect.Right != prdChar2.Rect.Right)
                        {
                            return(false);
                        }

                        if (prdChar1.Confidance != prdChar2.Confidance)
                        {
                            return(false);
                        }

                        if (prdChar1.CharData != prdChar2.CharData)
                        {
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }