Danyfirex Posted February 26 Share Posted February 26 Working now. probably It was web cache things. Saludos SmOke_N 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Mateocedillo Posted February 26 Share Posted February 26 (edited) Hi, This library is awesome, good job! Using the latest update, in the case of Spanish, it still does not behave well in some scenarios: 892867881741517 eight hundred ninety two trillion eight hundred sixty seven billion eight hundred eighty one million seven hundred forty one thousand five hundred seventeen Actual result: ochocientos noventa y dos billones ochocientos sesenta y siete mil ochocientos ochenta y un millones setecientos cuarenta y mil quinientos diecisiete Espected result: ochocientos noventa y dos billones ochocientos sesenta y siete mil ochocientos ochenta y un millones setecientos cuarenta y un mil quinientos diecisiete. The error is in "cuarenta y mil" > cuarenta y un mil. Edited February 26 by Mateocedillo Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 26 Author Moderators Share Posted February 26 I see, sorry, I was going blind trying to do the logic. That was a regex over look, nice catch. Looks like I'll be looking to do some (?<!) stuff Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 26 Author Moderators Share Posted February 26 2 hours ago, Mateocedillo said: 892867881741517 eight hundred ninety two trillion eight hundred sixty seven billion eight hundred eighty one million seven hundred forty one thousand five hundred seventeen Actual result: ochocientos noventa y dos billones ochocientos sesenta y siete mil ochocientos ochenta y un millones setecientos cuarenta y mil quinientos diecisiete Espected result: ochocientos noventa y dos billones ochocientos sesenta y siete mil ochocientos ochenta y un millones setecientos cuarenta y un mil quinientos diecisiete. The error is in "cuarenta y mil" > cuarenta y un mil. I believe I got it ... if not, we'll just call it TexMex 😂 Melba23 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 27 Author Moderators Share Posted February 27 Fixed a few issues I found on last release (for Spanish number to text) as well as added a text to number feature for Spanish. Danyfirex 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 27 Author Moderators Share Posted February 27 This is my absolute last update (already updated twice today) for a while. Added a generic way to get the language of the numerical text being passed to _AutCode_TextNumberGetLanguage(). See example in zip. See ya'll... 👋 argumentum and Danyfirex 2 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Mateocedillo Posted February 29 Share Posted February 29 Hi, Thanks for the bug fixes! You did a good job!👏🏻 I wrote an wrapper for your library that allows you to combine text and numbers at the same time:NumTextNum_wrapper.au3 And, if you want, I can use your library with a G2p (Grapheme to Phoneme) conversor that I'm doing these days. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 29 Author Moderators Share Posted February 29 2 hours ago, Mateocedillo said: Hi, Thanks for the bug fixes! You did a good job!👏🏻 I wrote an wrapper for your library that allows you to combine text and numbers at the same time:NumTextNum_wrapper.au3 And, if you want, I can use your library with a G2p (Grapheme to Phoneme) conversor that I'm doing these days. Thanks... use it as you wish, if you can find a use for it, it's more than I have atm lol. I assume that's a personal wrapper, the reason I ask is this block of code If Not StringRegExp($sString, "\d") Then Return $sString $aMatches = StringRegExp($sString, "(\d+)", 3) ; <-- only catches digits, what is delimiters are off? If @error Then Return SetError(2, 0, "") For $i = 0 To UBound($aMatches) - 1 ; Define if is decimal: $bIsDecimal = StringInStr($aMatches[$i], ",") Or StringInStr($aMatches[$i], ".") ; <-- how do you know what dec delimiter is when you're checking both types? If $bIsDecimal Then $sString = StringReplace($sString, ",", ".") ; <-- same with this ; Convert: Next is kind of redundant and delimiter specific. It's more loops than necessary honestly... I know I used to make my own personal wrappers with funcs that had a lot of parameters and I only used 2 or 3 of them lol... I assume that's what you did ... but I would just keep the language and decimal string change, that's all you need. Something like (untested, just throwing it out there: Func _NumTextNum_wrapper($sString, $sLanguage = "En", $bIsDecimal = True) Local $iLanguageId Local $sSeparator Switch $sLanguage Case "en" $iLanguageId = $N2T_LANGENGLISH $sSeparator = " point " Case "es" $iLanguageId = $N2T_LANGSPANISH $sSeparator = " punto " Case Else Return SetError(1, 0, "") EndSwitch $sString = _AutCode_NumberToText($sString, $bIsDecimal, "", $sSeparator, $iLanguageId) Return SetError(@error, @extended, $sString) EndFunc ;==>_NumTextNum_wrapper I have also re-written the find language func... but I'm not releasing it yet... I'm actually playing with a different structure idea. No clue what makes me keep looking at this ... smh Anyway, I'm not aware of the G2p thing, but best of luck to you all the same! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Mateocedillo Posted February 29 Share Posted February 29 9 hours ago, SmOke_N said: Thanks... use it as you wish, if you can find a use for it, it's more than I have atm lol. I assume that's a personal wrapper, the reason I ask is this block of code If Not StringRegExp($sString, "\d") Then Return $sString $aMatches = StringRegExp($sString, "(\d+)", 3) ; <-- only catches digits, what is delimiters are off? If @error Then Return SetError(2, 0, "") For $i = 0 To UBound($aMatches) - 1 ; Define if is decimal: $bIsDecimal = StringInStr($aMatches[$i], ",") Or StringInStr($aMatches[$i], ".") ; <-- how do you know what dec delimiter is when you're checking both types? If $bIsDecimal Then $sString = StringReplace($sString, ",", ".") ; <-- same with this ; Convert: Next is kind of redundant and delimiter specific. It's more loops than necessary honestly... I know I used to make my own personal wrappers with funcs that had a lot of parameters and I only used 2 or 3 of them lol... I assume that's what you did ... but I would just keep the language and decimal string change, that's all you need. Something like (untested, just throwing it out there: Func _NumTextNum_wrapper($sString, $sLanguage = "En", $bIsDecimal = True) Local $iLanguageId Local $sSeparator Switch $sLanguage Case "en" $iLanguageId = $N2T_LANGENGLISH $sSeparator = " point " Case "es" $iLanguageId = $N2T_LANGSPANISH $sSeparator = " punto " Case Else Return SetError(1, 0, "") EndSwitch $sString = _AutCode_NumberToText($sString, $bIsDecimal, "", $sSeparator, $iLanguageId) Return SetError(@error, @extended, $sString) EndFunc ;==>_NumTextNum_wrapper I have also re-written the find language func... but I'm not releasing it yet... I'm actually playing with a different structure idea. No clue what makes me keep looking at this ... smh Anyway, I'm not aware of the G2p thing, but best of luck to you all the same! Hi, Regarding to the matches and regex. The loop that is used is to combine numbers and text at the same time, that is why I have included it. For example. $sText = "July 23, 2024." _NumTextNum_wrapper($sText) So, this can return July twenty three, twenti twenti three becaus the original UDF is not cappable to process text and numbers at same time. The decimal thing is a good idea that I have to develop as well. Thanks for your suggestions! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 29 Author Moderators Share Posted February 29 Yeah, it's not for text and numbers at the same time... that's what we as programmers are supposed to do (which is why I thought you wrote your wrapper... eg. a personal preference) lol... I'm not gonna write an entire parser (well I don't think I am 😶). Just looking at multiple languages and trying to understand how they are formed just for numbers gives me a headache. I have an update for this version already... but I'm playing around with a different way of doing things .. while I think the new way is safer atm and has the ability to do more with more languages without getting lost in 10s of thousands of lines of code... I'm noticing a bit of a speed difference... about 15ms, and it's annoying me. So I'll play around with that for a while to see where it can go if anywhere, then I'll post both versions in the first post. Mateocedillo 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 1 Author Moderators Share Posted March 1 Ok, added a version that uses SQLite. It's slower more than likely, so why? 1. I was just going to use Map funcs, but they're still experimental and I'm a bit weary of something like that for my personal works because it could be removed at any time. 2. My database skills haven't been used in nearly a decade, I've forgotten more than some know lol. So I used this for practice to get me started again. 3. Once it's optimized, it may still be slower, but less code will be needed for future languages and will make it easier to grow. Having said that last part, I feel safer with the DB version, so I will not be updating the hard code one. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 3 Author Moderators Share Posted March 3 Added German and French for giggles, not extensively tested, but passed my mini QA. Remember, only updating the DB version. Danyfirex 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now