AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Simple Perl Examples
 
 
  [ # 16 ]

Actually, I can do you one better, if you like. I can save the file in UTF8 or Unicode (your choice) and toss it into a tarball, and host the file in the downloads section of my website. I can also, if desired, prepare a zip file for Windows users. These are trivial matters, taking little time or effort. Just let me know. smile

 

 
  [ # 17 ]

Ok, I emailed you the 2 files.

@Chuck - do not bother trying to copy and paste from the posting here - the quote marks are all messed up.  Dave is going to host them on his site and provide us a URL or what to click on from GeekCaveCreations.

@Erwin - we need a download section !!

 

 
  [ # 18 ]

I got your 2 emails, Victor, but I just got up, and haven’t had my coffee yet. Give me a couple, and I’ll zip them up, and post a link. Do you have any licensing information in the files? And if not, would you like me to add some? I generally use the GNU General Public License with my published source files, myself. smile

 

 
  [ # 19 ]

Did someone say COFFEE ?!!!  nice.. think I’ll have some….

Sure, the GNU GPL is good - feel free to fix a bit of indenting, and any updates you want.  The one script only goes up to 999 thousand, you may want to update it so it goes to millions, billions, trillions,etc grin

 

 
  [ # 20 ]

Ok, I’ve added copyright and licensing information to the files, and archived them into a zip file for Windows users, and a tarball for *nix users. I know that there are means for each to use the other, but I’m nothing if not accommodating. smile

The files can be found on my Downloads page.

 

 
  [ # 21 ]

Cool .. . I took out my postings which listed all the code inline and just put the URL to your page…  I put that right in the first post of this thread.

 

 
  [ # 22 ]

I think, Victor, that perhaps it would have been best to have left the code on place. But the decision is wholly yours. smile

 

 
  [ # 23 ]
Victor Shulist - Jul 23, 2010:

This example is a tool to convert numbers (integers only) between 0 and 999,999 into words.  Example, “593” returns “five hundred ninty three”.

Ah…

So something similar to the 6 year old Num2Word code from PetaMem? wink

http://search.cpan.org/~rvasicek/Lingua-Num2Word-0.07/Num2Word.pm

Albeit that old framework is multilingual.

But as you point out the really interesting stuff is the inverse Word2Num framework:

User: how much is twenty seven divided by nine
Bot:    The result is 3.

Uses a wrapper to catch the multilinguality and Parse::RecDescent for the input in every single supported language. (AFR CES DEU ENG EUS FRA IND ITA JAP NLD NOR POL POR RUS SPA SWE ZHO)


Richard

 

 
  [ # 24 ]

lol, I’m not sure about Victor, but I know I never claimed these were original ideas. I, for one, am well known by some for “re-inventing the wheel”. smile

 

 
  [ # 25 ]
Dave Morton - Jul 27, 2010:

lol, I’m not sure about Victor, but I know I never claimed these were original ideas. I, for one, am well known by some for “re-inventing the wheel”. smile

The PetaMem code is actually “re-inventing the wheel”. One such wheel (and I’m pretty sure I wasn’t the first one) I crafted back in the late 80ies in GFA-BASIC on my ATARI ST.

My fathers company needed to print out checks and they had a field for the numeric value (amount) and a line to print out that value in words. All was in German back then, so

427 = “vierhundertsiebenundzwanzig”

After some hard days of work I did it. But it took me about 20 years to be able to do it the reverse way - in arbitrary languages.

Richard

PS: And yes, I do it in Perl.

 

 
  [ # 26 ]

That’s more or less the reason why I had written the function I posted, as well. I wrote a management application for the cab company here that was web browser based, and managed every aspect of the company, including printing checks and cash receipts. The first function I posted came from that application.

 

 
  [ # 27 ]

Original ideas? lol.. no no..  I just had a bit of extra time and felt like coding something…. it was a cool little thing to write up quick smile

 

 
  [ # 28 ]

Morning, Victor.

Yup. That’s the reason for the second function. smile Well, that, and it being good practice.

 

 
  [ # 29 ]

HI Dave

Good practice also, yes, exactly.  As for re-inventing wheels, I do it from time to time, because the wheel I invent may work and integrate better with my system, also no legal issues, dependancies, etc…..   

When they made the first shopping cart, I don’t think they minded redesignng a wheel for it, even though wheels were already designed for cars, trucks, tractors, wheelbarrows ,etc

 

 
  [ # 30 ]

Richard,
GFA Basic?  That was my first high level programming language in ‘86. I had a blast with GEM (Graphics Environment Manager).  Remember the documentation?? There wasn’t much…was there?  Those were the days before ‘Google’. =)

I did write an electrical drawing program in GFA Basic. Used the mouse to draw resistors and batteries…connecting them with wire. The program calculated current and voltage drops in a series circuit. That was my first ‘awesome’ program…and then I traded the ATARI for some scuba equipment so I could dive off the coast of beautiful southern California. It was a tough trade though.

Thanks for the link.


Regards,
Chuck

 

 < 1 2 3 > 
2 of 3
 
  login or register to react
‹‹ New Sitepal Features      Simple PHP Examples ››