DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: [Solved] help convert short text manipulations code from perl to AHK  (Read 7,877 times)

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,175
    • Coding Snacks
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Anyone good at both perl and AHK? If so, care to help translate the format.pl code in the zip here http://nod5.dcmembers.com/tiffdjvuocr.html ? I'm not getting it right.
« Last Edit: May 17, 2010, 08:15 PM by Nod5 »

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • Plugin Coding Medal
    • Participated in NANY Challenge Three Times
Re: help convert short text manipulations code from perl to AHK
« Reply #1 on: May 16, 2010, 10:34 AM »
Don't know how much help I might be, but I've taken a brief look at format.pl.

One thing I wondered about was its specification of utf8 in the input and output from/to files:

Code: (perl)
open TXT, "<:utf8", "page_txt.txt";
open BOX, "<:utf8", "page_box.txt";
...
binmode(STDOUT, ":utf8");

I'm not experienced with AHK in that realm, but have the sense that that might present a tricky (or at least not-so-trivial) situation.

My impression so far with the rest of the script is that it doesn't look too bad.  May be if we can get close enough, help might arrive for any remaining difficulties :)

Do you have any sample input files and corresponding expected output that I might test with?

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,175
    • Coding Snacks
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: help convert short text manipulations code from perl to AHK
« Reply #2 on: May 16, 2010, 03:11 PM »
txt examples attached (based on source image from http://www.pgdp.net/d/walkthrough/04_Proof.htm )

there's also a python version of the same text manipulation actions in the zip in this post http://www.diybookscanner.org/forum/viewtopic.php?f=3&t=319&p=3300%23p3300#p3302 ; (between the ##### in the code)

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,175
    • Coding Snacks
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: help convert short text manipulations code from perl to AHK
« Reply #3 on: May 17, 2010, 08:13 PM »
Help received through PM, case closed. Thanks again ewemoa!  :Thmbsup:

Original address: https://www.donationcoder.com/forum/index.php?topic=22749.0