0
votes

I'm programming Java and using a MySQL database. Would it be possible to send a rather large string (+/- 500 words) to the database. Next I want it to remove ALL words that are NOT in the database, with this removing stopwords, misspelled words and other noise. After the shorter string should be returned. So all should preferably happen in the database itself

Is this possible in some way? The solution should be fast since I have +/- 6million strings like that.

2

2 Answers

1
votes

Yes. This is possible and the implementation should be a trivial exercise.

0
votes

Try something like this:

                 //statement that checks to make sure user enters only letters
                 if(fname.matches("[a-zA-Z]+"))
                 {
                    //updates 'Fname' field in db to text that user inputted in 'fname' textfield
                    rs2.updateString("Fname", fname);
                 }

                 //statement that prompts user if they enter something other letters
                 else
                 {
                    JOptionPane.showMessageDialog(null, "Please enter first name in correct format!");
                    fNameTextBoxResults.setText("");
                 }

thats some logic, instead of using "fname" use your db name and check if selected words are contained in your db...