Author Topic: Auto-Correcting Worded numbers to digits, questions  (Read 3939 times)

Spitfire2600

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
Auto-Correcting Worded numbers to digits, questions
« on: August 10, 2016, 07:44:44 pm »
I'm working on a few plug-ins and an update to my Smart Alarm, but I realized if for any reason a number is in written form (six-fifty-seven) as opposed to digits (6-50-7) Hal will throw an error at me... As I have nothing coded to deal with such a chaotic event.. I don't suppose anyone else has already done this or made a plug in? Maybe it's as easy as a substitution table? I could be totally overthinking how to go about it, but I would theoretically have to make a table line for every number to infinity to replace written to digit, right, because any shortcut Hal did substitute (Twenty one) for (21) wouldn't the table actually tell Hal to make the conversion (20 1)? I mean, there can't possibly be a simpler way.

Thanks for any advice.

-Spitfire 
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3854
    • View Profile
Re: Auto-Correcting Worded numbers to digits, questions
« Reply #1 on: August 11, 2016, 10:34:46 am »
Perhaps a little more information regarding what you're trying to accomplish might help shed some light.
I thought you had the dates and time numbers accounted for within the plugin.

I did try Hal with a lock combination and it responded with the same numbers. I typed them as 4 28 15 without any separators like - or / between them. With that, I still see no method of dealing with them on an individual basis when presented like my combination lock numbers.

Please enlighten when you get time. Thanks!
In the world of AI it's the thought that counts!

- Art -

Spitfire2600

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
Re: Auto-Correcting Worded numbers to digits, questions
« Reply #2 on: August 11, 2016, 04:47:16 pm »
I simply mean taking a written number such as "Five" and using it in any code that requires numerals like "5" will cause an error. A basic plug-in to substitute the written "FIVE" for "5"

Basically, by-pass any possible way for a written number to end up in Hals input box.
 

peace

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Auto-Correcting Worded numbers to digits, questions
« Reply #3 on: August 18, 2016, 01:18:12 am »
Your talking about context .... That's complicated for example if you said eight how does Hal know the difference between 8 or ate? Try seperating it with a comma and write a plugging to case out a format

Spitfire2600

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
Re: Auto-Correcting Worded numbers to digits, questions
« Reply #4 on: August 18, 2016, 03:35:14 am »
A feature I added to my Smart Alarm is simply telling Hal the time you want the alarm set. However, if you say "eight fifty nine pm" instead of "8 59 pm" It will result in an error.
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3854
    • View Profile
Re: Auto-Correcting Worded numbers to digits, questions
« Reply #5 on: August 20, 2016, 08:43:18 am »
 Most people do not write out Time formats in longhand but rather use numbers instead. I use words when I type text to Hal. I type numbers when I use Time or Math issues. Most clocks I know of use numbers as well. 😉

In the world of AI it's the thought that counts!

- Art -

Spitfire2600

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
Re: Auto-Correcting Worded numbers to digits, questions
« Reply #6 on: August 20, 2016, 02:26:36 pm »
I know that, I'm just trying to make this code fool proof. There's no real point in finishing it otherwise.
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3854
    • View Profile
Re: Auto-Correcting Worded numbers to digits, questions
« Reply #7 on: August 21, 2016, 08:15:56 am »
There are a lot of possible permutations of just one possible time reference, not to mention all other possibilities.zero to nine in seconds, one to six in minutes and one to twelve for hours.
Twenty,thirty,forty etc
That's just for standard time. Military goes past twelve hundred hours, thirteen hundred hours, ...etc..
Don't forget to include the word zero and the letter O as it's often pronounced "O six forty five" instead of "zero six forty five" Some might include dashes as saparators.

I'm just saying it's going to be a huge task to include all possibilities for a very niche group that might actually put it to use.

By all means, I'm not trying to discourage you...just throwing more wood on the fire.
In the world of AI it's the thought that counts!

- Art -