Hello there! I am currently working on developing an application that can recognize voice and convert it into text. I have successfully implemented the conversion and comparison features, but there are specific words that I need to modify or replace in the text. Initially, I attempted to use an if statement to achieve this, but it negatively impacted the performance of the application. As a result, I am looking for a solution that will allow me to efficiently filter and replace a large group of words while maintaining optimal performance.
Here is an example of what I have done:
If(inputText.getText().toString().contains("A Specific Word")){
String before;
String after;
before = inputText.getText().toString();
after = before.replaceAll("A Specific Word", "ASW");
inputText.setText(after);
}
However, this approach is causing performance issues.