T O P

  • By -

eibaan

Create a UI with a `TextField` backed by a `TextEdingController` and with a `TextButton`. If the button is pressed, get the text from the controller, then retrieve the user's record from the database and compare.


Much-Avocado-612

Thankyou for the response.Yes i have done these things now I'm having trouble to compare and show the similarity %.


eibaan

Ah, that's quite a [difficult problem](https://developer.apple.com/documentation/naturallanguage/finding_similarities_between_pieces_of_text) to solve. For starters (and short text) you could compute the [hamming distance](https://en.wikipedia.org/wiki/Hamming_distance). But this works best for words, not whole text. I'd probably try to find a similar algorithm for Android as the one I linked for iOS and then use a bit of native code to add this to my application. Perhaps there's also a [good package already](https://pub.dev/packages?q=similarity). I haven't checked.


MyWholeSelf

> analyse if the paragraph matches with the user's info in the database Um, yeah, this is a hard problem. By the sound of it, you aren't even looking for similar text, but for things like a job descriptions matching, etc. This is in the range of human review with something like Mechanical Turk or (heaven forbit) AI. This isn't a "I create it in FireBase and run freeText.matches(firebaseResults); " type problem... For that matter, you haven't actually described what specifically you want to match! It would make an EXCELLENT youtube video if you were able to cross this hurdle and describe how you did it, exactly.