Jump to content

Mateocedillo

Active Members
  • Posts

    72
  • Joined

  • Last visited

Everything posted by Mateocedillo

  1. 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!
  2. 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.
  3. 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.
  4. Hi, I have been trying to do something for Spanish, but there are things that I surely have to improve. Here's my code: #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include-once Global $nNumber, $bIncludeAnd, $sNumber MsgBox(0, "Result", NumberToWords(23456, False)) Func NumberToWords($nNumber, $bIncludeAnd = True) Local $aOnes = StringSplit("cero,uno,dos,tres,cuatro,cinco,seis,siete,ocho,nueve", ",") local $aTildes = StringSplit("dós,trés,cuatro,cinco,séis,siete,ocho,nueve", ",") Local $aTeens = StringSplit("diez,once,doce,trece,catorce,quince,dieciseis,diecisiete,dieciocho,diecinueve", ",") Local $aTens = StringSplit("dieci,veinte,treinta,cuarenta,cincuenta,sesenta,setenta,ochenta,noventa", ",") Local $aHundreds = StringSplit("cien,doscientos,trescientos,cuatrocientos,quinientos,seiscientos,setecientos,ochocientos,novecientos", ",") local $bTilde Local $sNumber = "" If $nNumber = 0 Then $sNumber = "cero" ElseIf $nNumber < 0 Then $sNumber = "menos " & NumberToWords(Abs($nNumber), $bIncludeAnd) Else If $nNumber >= 1000000 Then $sNumber = NumberToWords(int($nNumber / 1000000), $bIncludeAnd) & " millones " If $bIncludeAnd And mod($nNumber, 1000000) Then $sNumber &= "y " $nNumber = mod($nNumber, 1000000) EndIf switch $nNumber case 1 to 1999 ; para evitar que convierta "uno mil xxx" if StringLen($nNumber) = 4 and StringLeft($nNumber, 1) = 1 then $sNumber &= "mil " case 2000 to 999999 $sNumber &= NumberToWords(Int($nNumber / 1000), $bIncludeAnd) & " mil " EndSwitch If $bIncludeAnd And mod($nNumber, 1000) Then $sNumber &= "y " $nNumber = mod($nNumber, 1000) switch $nNumber $bTilde = False case 100 ; número propio. $sNumber &= "cien " case 101 to 199 ; aquí se tendrá que convertir ciento. $sNumber &= "ciento " case 200 to 999 ; aquí doscientos, trescientos, cuatrocientos, etc. $sNumber &= $aHundreds[Int($nNumber / 100)] & " " EndSwitch $nNumber = mod($nNumber, 100) If $nNumber >= 20 Then if StringRight($nNumber, 1) >= 1 then If not StringLeft($nNumber, 1) = 2 then $bTilde = False $sNumber &= $aTens[Int($nNumber / 10)] & " y " Else $sNumber &= "veinti" $bTilde = True EndIf Else $sNumber &= $aTens[Int($nNumber / 10)] & " " EndIf $nNumber = mod($nNumber, 10) ElseIf $nNumber >= 10 Then $sNumber &= $aTeens[$nNumber - 9] & " " ;$nNumber = StringRight($nNumber, 1) $nNumber = 0 EndIf If $nNumber > 2 Then if $bTilde then $bTilde = False $sNumber &= $aTildes[$nNumber-1] & " " Else $sNumber &= $aOnes[$nNumber+1] & " " EndIf EndIf EndIf Return StringStripWS($sNumber, $STR_STRIPLEADING + $STR_STRIPTRAILING + $STR_STRIPSPACES) EndFunc
  5. Hi @kcvinu, Thank you! I hope key accelerators or navigating will be implemented, I read through the wrapper glance.au3 and only found possible things that can be done with EventHandler (key_handle and key_press) of which I doubt that key accelerators can be set for all GUI controls that possible to create, I think it is related to the library in Nym. Please let me know news about this, and if you need to do tests regarding this function (eg. With a screen reader), I will be happy to do it.
  6. Hi, First, thanks @kcvinker for this great work! I have a suggestion: can be add navigation through the controls using the keyboard? Something like what $ws_tapstop does. I ran the example code, but keyboard navigation (for example, using tab key) isn't possible. This can be useful to improve accessibility for blind people.
  7. Hi @SOLVE-SMART, Thanks for the collection, I'm on the list and it's also appreciated. Currently, I'm working on a project in au3, which I will publish soon once I finish fixing many bugs. Also, I apologize. I admit my above code isn't the best in the world, but I'm open to pull requests for improvements.
  8. Hello, Does this work with AVG Antivirus? Because this is overprotecting execution whit a compiled script and autoit3.exe. An exclusion could be added, but it's really annoying.
  9. Cheers, I have a plan to develop something but there is a problem. I want to develop a load function, this function will generate two arrays with totally different values and the problem is how AutoIT could return these two different arrays in one function. Here's an example of what I'm trying to say: local $aArray1, $aArray2 $aArray1, $aArray2 = _Test_func() Func _Test_func() local $aArrayA = [1, 2, 3] local $aArrayB = [4, 5, 6] return $aArrayA, $aArrayB EndFunc
  10. Hello, I have written a small UDF containing some Python string functions for AutoIt, because I know it can be useful to many. ; misc string functions ; by Mateo C ; #FUNCTION# ==================================================================================================================== ; Name ..........: _String_startsWhit ; Description ...: Checks if the string starts with a specific criteria, similar to the function in Python. ; Syntax ........: _String_startsWhit($sString, $sStart) ; Parameters ....: $sString - The string to be examined. ; $sStart - A value (string) to check. ; Return values .: True if the string starts with that value; otherwise, return false. If $sString is not a string, return @error. ; Author ........: Mateo Cedillo ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _String_startsWhit($sString, $sStart) If Not IsString($sString) Then Return SetError(1, 0, "") Return $sStart = StringLeft($sString, 1) EndFunc ;==>_String_startsWhit ; #FUNCTION# ==================================================================================================================== ; Name ..........: _String_EndsWhit ; Description ...: Checks if the string ends with a specific criteria, similar to the function in Python. ; Syntax ........: _String_EndsWhit($sString, $sEnd) ; Parameters ....: $sString - The string to be examined. ; $sEnd - A value (string) to check. ; Return values .: True if the string ends with that value; otherwise, return false. If $sString is not a string, return @error ; Author ........: Mateo Cedillo ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _String_EndsWhit($sString, $sEnd) If Not IsString($sString) Then Return SetError(1, 0, "") Return $sStart = StringRight($sString, 1) EndFunc ;==>_String_EndsWhit miscstring.au3
  11. This is a toolkit, aimed at the topic of cloning voices. FakeYou is a page where artificial intelligence technology is used to clone voices. This is about algorithms that seek to imitate the original speaker, this is based on audio or recordings of the speaker, from sound files such as wav. You can publish your own creations, which means that you can train your own voices or the one you want. There are thousands of voices. The page has API support where you can use this service in an app, like Discord for example. Therefore, this toolkit has the support to use the FakeYou API with AutoIt. In addition to other features such as data set management that are used to train a voice that we want, for example: Fix audios and transcriptions, convert, among many other things! Note: this toolkit does not have enough examples to demonstrate all the features, but you can see the code for each of the libraries/includes. credits: Special thanks to: @danifirex, @pixelsearch and @Subz Here is the code. I look forward to your suggestions or comments!: https://github.com/rmcpantoja/FakeYouTools
  12. Hello, tf has nothing to do with audio, transcripts and such. In fact I'm looking for the same thing to train tt2 models, there may be some ASR or voice recognition API that allows me to do this.
  13. I understand. Well, anyway feel free to send pull requests and so on, although I know I have to do my part and I take it into account. It takes me about 20-30 seconds to finish. And yes, I think the last items (created at and updated at) may not be necessary for now, so I'll think about doing something to speed up the process, as well as alternatives. Thank you anyway...
  14. Well, in case more is needed, a sample of this is a UDF that I have been making in the company of @Danyfirex. Especially, in the FakeYou.au3 UDF, functions _FakeYouGetVoicesList and _FakeYouGetCategoriesList (in the latter it is acceptable but in the previous function it takes time to process the data) This is the GitHub: UDF repository BTW, I'm sorry for my english...
  15. Hello, thanks for your answers. I'll try the UDFs you provided and let me know how it goes, though we'll most likely have to rewrite parts of a JSON-based UDF. About JSMN, the danger and the code injection, the truth would be needing a little more context... Well, I'll explain and I'm sorry in advance if I didn't make myself understood. Yes, that is what I meant. This UDF uses JSON.au3, and the contents of the JSON that take time to process are arrays that contain information, and what we do is extract that data from the JSON array to convert it into an array for the UDF to manipulate and examine it.
  16. Hello, Can you speed up the processing speed on long JSONs that contains much items? That is, I have a JSON that has an array of more than a thousand elements and I am getting them all in an Array but it takes a long time, depending on the number of elements. In other cases like browsers or Python it gets them all almost instantly. I have the latest dependency (2021.11.06).
  17. Thank you, the truth is that the two solutions have served me. The truth is that it seemed unpleasant to me that the list appeared out of order, I thought that was already a defect of the search engine or the system and it is a bit difficult to deal with something like making an order. Again, thanks for u help.
  18. Hello, Thanks for your answer. Yes, for a moment I had thought about the _FileListToArrayRec thing, but there is another problem here. Taking the example of your script, I want to order the elements of the Array that has the files, since with a dataset of 5 wavs like the one I passed it works fine, but in a large dataset like 500 wavs the txt of the list is untidy. For example, on one line there is wavs/1.wav| but in another there are wavs/10.wav| where wavs/2.wav| would have to go instead, that is, in an ordered way. I used _ArraySort but it gave no results.
  19. I'm trying to create a function, which what it does is make an Array of file names so that it is later converted into a list and creates a file with the list that this Array has. The problem is that the syntax for this list or transcripts is wavs/num.wav|. So, I guess the "|" is misunderstood by the _array functions, which I call only for debugging. So I would need suggestions for this please - I'll share the code here and at the end a zip file with something to get this working. Thanks. #include <Array.au3> #include <File.au3> $bCreate = _Dataset_CreateTranscription(@scriptDir &"\mylist.txt", "FW") if @error then MsgBox(16, "Error", @error) if $bCreate then MsgBox(0, "Ready", "Your transcription has been done correctly.") Func _Dataset_CreateTranscription($sFileName, $iMaxItems, $sWavsPath = @ScriptDir &"\wavs") if FileExists($sFileName) then return SetError(1, 0, "") ;The transcript file already exists. if $iMaxItems = "FW" then $iMaxItems = 0 $hFiles = FileFindFirstFile($sWavsPath &"\*.wav") If $hFiles = -1 Then return SetError(2, 0, "") ;Files with the wav extension are not found. Local $aFileNames[], $aResult[], $iIndex = 0 While 1 $aFileNames[$iIndex] = "wavs/" &FileFindNextFile($hFiles) &"|" If @error Then ExitLoop Sleep(10) $iIndex = $iIndex +1 WEnd ;test: _ArrayDisplay($aFileNames) ;debug: if @error then MsgBox(0, "ArrayDisplay error", @error) _ArrayDelete($aFileNames, $iIndex) _ArraySort($aFileNames) _FileWriteFromArray($sFileName, $aFileNames) Else $hFile = FileOpen($sFileName, 1) If $hFile = -1 Then return SetError(3, 0, "") ;the transcription file could not be created. EndIf if not isInt($iMaxItems) then return SetError(4, 0, "") ;The maximum number of elements is not an integer. For $I = 1 to $iMaxItems FileWriteLine($hFile, "wavs/" &$I &"|") Next FileClose($hFileOpen) EndIf return true EndFunc Dataset text.zip
  20. And I clarify: With GuiGetMsg() there is no way to solve this, since this has a sleep to avoid CPU consumption. But isn't there some way that even though we have a sleep it doesn't affect the performance of navigation with a graphical interface in screen readers? And the truth is, I tried with AutoHotKey and this does not happen, this is because it is a different language, while is not used to keep the script running and such.
  21. How had it not occurred to me before! Here is an example of GuiCtrlSetOnEvent, but commenting out the sleep in the loop. And this makes for a negligible increase in GUI navigation performance with screen readers such as NVDA. Navigation is very fluid as in many applications: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() Opt("GUICoordMode", 2) Opt("GUIResizeMode", 1) Opt("GUIOnEventMode", 1) GUICreate("Parent1") GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents") GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents") GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents") GUICtrlCreateButton("OK", 10, 30, 50) GUICtrlSetOnEvent(-1, "OKPressed") GUICtrlCreateButton("Cancel", 0, -1) GUICtrlSetOnEvent(-1, "CancelPressed") GUISetState(@SW_SHOW) ; Just idle around While 1 ;Sleep(10) WEnd EndFunc ;==>Example Func OKPressed() MsgBox($MB_SYSTEMMODAL, "OK Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & " CtrlHandle=" & @GUI_CtrlHandle) EndFunc ;==>OKPressed Func CancelPressed() MsgBox($MB_SYSTEMMODAL, "Cancel Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & " CtrlHandle=" & @GUI_CtrlHandle) EndFunc ;==>CancelPressed Func SpecialEvents() Select Case @GUI_CtrlId = $GUI_EVENT_CLOSE MsgBox($MB_SYSTEMMODAL, "Close Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle) Exit Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE MsgBox($MB_SYSTEMMODAL, "Window Minimized", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle) Case @GUI_CtrlId = $GUI_EVENT_RESTORE MsgBox($MB_SYSTEMMODAL, "Window Restored", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle) EndSelect EndFunc ;==>SpecialEvents And now, what happens if we un-comment the sleep? Simply, the behavior is the same. There is a small delay in navigation. You could download NVDA from nvaccess.com and have a try.
  22. Let's see... First of all, reduce code instead of calling many functions, when in reality these functions can only be linked to one. This also prevents spam, for example this part is repeated the most: shellexecute("c:/windows/chatterbots/Snoop Dogg.mp4") Sleep(Random(6131,6132, 1)) MsgBox(4096, "Snoop Dogg", ($cool1)) Instead of calling these three functions, you can create a function for example _ShowText($sText) here is an example: Func _ShowText($sText) shellexecute("c:/windows/chatterbots/Snoop Dogg.mp4") Sleep(Random(6131,6132, 1)) MsgBox(4096, "Snoop Dogg", $sText) EndFunc Suggestions: In other cases, when I'm talking to the bot it tells me that the video can't be found, obviously because I don't have it. It would be nice if this video playback and sleep time is optional.
  23. Ah, I think I understand and I hope you do too. What @rogerdodger wants to do is a chat robot, an example is Elisa or Dr. Abuse, which are robots where you can write any text and the robot responds according to the text you write. And yes, a training process can be done for this, and I see that in your code there are lines with questions and answers from the bot, all with loose conditionals, and this code can be saved with arrays and so on. I have an idea of this, so I could help you, but I would need you to confirm if that is what you are looking for.
  24. Hello, From what I understand, a solution can be: * Use ControlGet functions. * Get the handle of the edit control, that is, the input field. * then get the text or the last line of the edit control. This can be done with a loop, but you could keep in mind that: * you have to control the way the chat is registered, that is: * if there is new text, do something. Otherwise, it waits until new text is found. * the rest is up to your creativity.
×
×
  • Create New...