I'm a complete newbie in app building and MIT AI2. Everything has actually started for fun.
I'm trying to build a simple app logging for each entry: picture, text ,dates
At the moment I'm struggling managing date field.
I try to explain my starting point and my direction and please suggest me which is the best way to make it clear
At the moment I using as exercise TaifunSpeechRecognizer extension to fill text boxes.
getting to the point, I have one text box showing, let say 6th October 2024 recognized from my speech. I want to fill a new textbox with date plus let say 2 years.
The question is how I convert the speech -> text (6th October 2024) -> date format?
My idea is after speech -> date conversion to use dintDate extension to manipulate it
this is the sort of idea I had in mind but didn't have the knowledge to transform a thought to coding.
I have some questions about ur coding expecially why did u use the screen1.inizialize block but let me do some testing first trying to fit ur idea to my project and I'll revert with more accurate feedback
Coming from more structured languages this block coding is really fashinating!!!
@gipsea Since you didn't post a *.aia with your code, I only used screen1.initialize block to reproduce the conditions of your question... using a fixed input... to help you to think... but you will have to adapt this to your idea.
Screen Initialize is the first event that will be triggered when the home screen is displayed on the device.
If you need more sophisticated operations with the final date, the blocks of this solution will turn such information into a date parameter that 'Clock' can manipulate with many more features »
Well...I'm happy I triggered ur interest for the sake of both success.
I'm not sure u can quickly give an extra help before starting a new thread.
The app is going to be used by an international group of user (different languages) and also extra time could be +XX months and not only +2 years
Your month list is great for english speakers only. Considering time format, I would say that using some time format "MMMM" will return the month name in the spoken language. If this it true then I can convert my text to a complete time/date format able to add any amount of time regardless language.
Ar you aware of such option?
I can't find the time&date formats letters to be more precise but I will evenctually get there;)
In this case the programming becomes much more complex ...
If the app is going to be used by an International Group of Users, in different language, speech recognition should be chosen at the beginning of a list of languages, according to @taifun extension specifications...
At this point, a variable will have the result of the chosen language »
According to the number of possible languages that will be contemplated, the date recognition of the date that is spoken will be different ... Just like the months of the year and the treatment of the date for each possibility ...
This presupposes some 'extra' blocks »
For each language contemplated you will need a list of months in this language ... for example »
... and in the 'event' that indicates that the language was chosen, there will be a command that 'decide' which list of months for this choice »
... something like a procedure for a global variable to memorize that the ongoing month list is one of them in the chosen language.
The treatment of the string that will isolate the number of the day - for that clock understands it - should also be different, according to the language ... because what Speech Recognition understands for October 6, 2024 in English » 6th October 2024 » will not be equal in German » 6. Oktober 2024 » or Spanish » 6 de Octubre de 2024 » ... and you will need to contemplate each of these possibilities with isolated procedures for each language, as there will be a different number of spaces between each information, the order may change of place, etc.
In this regard, you will need to have different operations on your project than you may or you will want to do... Assigning Labels or TextBoxes the parameters of hours, minutes, days, months or years to be added / subtracted with each date... and the formulas of the blocks should also contemplate this.
Understand that the solution indicated above is not intended to be complete that solves everything at once... it was just a model to help you think... and just as it was not contemplated the possibility of 'th', 'nd', etc.in the first example, analyzing the blocks you will be able to find solutions for everything reproducing logic.
In fact, your project looks quite ambitious for those starting... and you will take a long time reading the Helps of the language to be able to do everything you want. Isolates every problem. Perhaps, with each step, you need to open new topics to solve each question... But solving one problem at a time, every step, there will be a time when your ambitious project will be ready. Go ahead @gipsea!
BTW: It would be much easier if instead of the 'base date' to have to be extracted from the result of a Speech Recognition was a Datapicker.
The user would already choose the date of a calendar in their language -with one click- and would not have to process numerous adaptations to extract the relative data. I agree that it is very 'fashion' to be able to speak the date... but the code required to get around this -in many languages- it becomes much more complex.
regarding language setup, I'm using the taifunspeechrecognizer which has blocks about picking local language. (next step is to save on a DB as settings)
string as date: I new it was a long shot try to convert string 2 date format. I did on python but string format was fix and could be easily split and convert. Playing around helped finding the critical aspects as we said the presence of st,nd,rd, th or possibly other. it is almost a dead end unless investigating all possibilities produced by speechrecognition but considering time, costs and maintenance request it is out of discussion at least for the moment
Datapicker: I gave a look yesterday night but did not investigate too much or let say didn't coded to get a grip of it. It was my plan for today
starting from your first code which added 2 years to the list, I played around using months. Once we get an idea about guidelines used by the developers of the module it is almost a straight forward process to manipulate actions withing the module
I'm taking now a look at your link. I'm sure it is a another great starting point.