예제 #1
0
        protected virtual void GetLinesOfPage(Intarray lines, int ipage)
        {
            lines.Clear();
            string     dirName  = String.Format("{0}{1}{2:0000}", prefix, Path.DirectorySeparatorChar, ipage);
            DirPattern dpattern = new DirPattern(dirName, @"([0-9][0-9][0-9][0-9])\.png");

            if (dpattern.Length > 0)
            {
                lines.ReserveTo(dpattern.Length);
            }
            List <int> llist = new List <int>(dpattern.Length);

            for (int i = 0; i < dpattern.Length; i++)
            {
                int k = int.Parse(dpattern[i]);
                llist.Add(k);
                //lines.Push(k);
            }
            IEnumerable <int> query = llist.OrderBy(i => i);

            foreach (int iline in query)
            {
                lines.Push(iline);
            }
        }
예제 #2
0
 public override void SetPrefix(string prefix)
 {
     if (DirPattern.Exist(prefix, @"[0-9][0-9][0-9][0-9]", @"([0-9][0-9][0-9][0-9])\.png"))
     {
         Global.Debugf("info", "selecting OldBookStore");
         p = new OldBookStore();
     }
     else
     {
         Global.Debugf("info", "selecting (new) BookStore");
         p = new BookStore();
     }
     p.SetPrefix(prefix);
 }
예제 #3
0
파일: BookStore.cs 프로젝트: nickun/OCRonet
 protected override void GetLinesOfPage(Intarray lines, int ipage)
 {
     lines.Clear();
     string dirName = String.Format("{0}{1}{2:0000}", prefix, Path.DirectorySeparatorChar, ipage);
     //DirPattern dpattern = new DirPattern(dirName, @"([0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])\.png");
     DirPattern dpattern = new DirPattern(dirName, @"([0-9][0-9][0-9][0-9][0-9][0-9])\.png");
     if (dpattern.Length > 0)
         lines.ReserveTo(dpattern.Length);
     for (int i = 0; i < dpattern.Length; i++)
     {
         int k = int.Parse(dpattern[i]);
         lines.Push(k);
     }
 }
예제 #4
0
        public virtual int GetMaxPage(string fpattern)
        {
            int        npages   = -1;
            DirPattern dpattern = new DirPattern(prefix, fpattern);

            for (int i = 0; i < dpattern.Length; i++)
            {
                int p = -1;
                int.TryParse(dpattern[i], out p);
                if (p > npages)
                {
                    npages = p;
                }
            }
            npages++;
            return(npages);
        }
예제 #5
0
        protected override void GetLinesOfPage(Intarray lines, int ipage)
        {
            lines.Clear();
            string dirName = String.Format("{0}{1}{2:0000}", prefix, Path.DirectorySeparatorChar, ipage);
            //DirPattern dpattern = new DirPattern(dirName, @"([0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])\.png");
            DirPattern dpattern = new DirPattern(dirName, @"([0-9][0-9][0-9][0-9][0-9][0-9])\.png");

            if (dpattern.Length > 0)
            {
                lines.ReserveTo(dpattern.Length);
            }
            for (int i = 0; i < dpattern.Length; i++)
            {
                int k = int.Parse(dpattern[i]);
                lines.Push(k);
            }
        }
예제 #6
0
 protected virtual void GetLinesOfPage(Intarray lines, int ipage)
 {
     lines.Clear();
     string dirName = String.Format("{0}{1}{2:0000}", prefix, Path.DirectorySeparatorChar, ipage);
     DirPattern dpattern = new DirPattern(dirName, @"([0-9][0-9][0-9][0-9])\.png");
     if (dpattern.Length > 0)
         lines.ReserveTo(dpattern.Length);
     List<int> llist = new List<int>(dpattern.Length);
     for (int i = 0; i < dpattern.Length; i++)
     {
         int k = int.Parse(dpattern[i]);
         llist.Add(k);
         //lines.Push(k);
     }
     IEnumerable<int> query = llist.OrderBy(i => i);
     foreach (int iline in query)
         lines.Push(iline);
 }
예제 #7
0
 public virtual int GetMaxPage(string fpattern)
 {
     int npages = -1;
     DirPattern dpattern = new DirPattern(prefix, fpattern);
     for (int i = 0; i < dpattern.Length; i++)
     {
         int p = -1;
         int.TryParse(dpattern[i], out p);
         if (p > npages)
             npages = p;
     }
     npages++;
     return npages;
 }