priya-zha / Software-Engineering-Project

0 stars 2 forks source link

System should respond and select synonyms of male/female words when taking voice input from the user #1

Open priya-zha opened 11 months ago

priya-zha commented 11 months ago

Actual Result: If a user goes according to instruction of the app like if a user says 'men' or 'women', then the app works fine. But if they use synonyms of male/female , then the app responds by saying 'Invalid input'.

Expected Result: The app should select the male/female radio buttons and should play the corresponding voice in accordance with the synonyms provided by users as voice input.

In the current scenario, the system asks the user to speak men and women, to select the male/female voice preference which works fine. But to make the app robust in every possible cases, the system should also be able to respond if user tries to speak synonym words for male/female. For example, for men, it can be boy, man, gentleman, gentlemen, male etc. Similarly, for women it can be woman,girl,lady, ladies, female etc. So if a user says any other word as instructed, then the application would not be able to move forward until user speaks the word. Thus, this needs to be solved by providing multiple synonyms words for male/female since this is the initial stage of the application. If system gets wrong here, moving forward would be difficult.

Below is the video recording of the system that doesn't respond to synonyms of the voice user input for male/female words.

https://github.com/priya-zha/Software-Engineering-Project/assets/34065075/d922359e-783f-49de-9fe4-8225ab2b446c

Below is the video recording of the system where the bug has been fixed and the system successfully responds to synonyms of the male/female words and at the end selects the men/women button accordingly on the basis of the voice user input.

https://github.com/priya-zha/Software-Engineering-Project/assets/34065075/60c7b5af-4a87-426f-96d3-fbb4fe19e304

priya-zha commented 11 months ago

To accommodate variations in what the user might say, I'm using an if condition with an OR (||) operation. This allows the code to handle multiple synonyms for "men" and "women". This if condition checks if the recognizedText matches any of the provided synonyms for "men" and 'women" or related terms. If there's a match, it proceeds to handle the user's preference accordingly, including enabling the male radio button and female radio button, updating the gender variable, and performing actions like vibration and UI updates.

This code will effectively handle variations in the user's speech, allowing them to choose their gender preference even if they use different terms.

https://github.com/priya-zha/Software-Engineering-Project/blob/2da8cc17807297e2b2a7ec59d183edb1f416f06c/app/src/main/java/com/example/se/VoiceSelection.java#L188C16-L188C16

https://github.com/priya-zha/Software-Engineering-Project/blob/2da8cc17807297e2b2a7ec59d183edb1f416f06c/app/src/main/java/com/example/se/VoiceSelection.java#L203

Screenshot (23) Screenshot (24)