r/java • u/glesialo • Feb 01 '20
My last project: Document (file) searcher using pseudo fuzzy logic.
I write projects so far between that I have to re-learn Java each time. Fortunately it is like riding a bicycle, you never forget ;-)
This application searches for files using class FuzzyMatch with its methods rateWords() & rateSentences().
In normal search mode it chops each file into sub-path, name and extension and compares each 'sentence' with the corresponding search field.
Here are some use examples (I have omitted some word letters to show that it is not a simple 'grepper'):
The application has other, specialized, search modes adapted to my 'Common Library' which according to my notes:
... includes all types of documents in different formats, including
'bundles': archives including data and instructions on how to treat that data.
Multimedia (Audio, Video, Images) is also included in the libraries. Items are
sorted, in $COMMON_TEXT_DIR, by author and by categories as defined in
'$COMMON_ETC_DIR/CommonTextKeys': ls -lR $COMMON_ETC_DIR/CommonTextKeys
...Here are some use examples:
Images_1 // I have thousands of pictures, in slides, from a lifetime of traveling but I am too lazy to digitize them :-(
Please, let me know what you think of the application.
View all comments
Show parent comment
1
u/glesialo Feb 01 '20 edited Feb 01 '20
No it is just a hobby. I can't post 'org.common.libraries.*' because there are many other things there, unrelated to this project. I don't want to post the whole bunch and I don't feel like cutting/pruning and then posting those used by 'FindDocuments'. It uses many small simple classes and some a bit more complicated like JTextAreaWithCentredText, which adjusts a JTextArea's font to fit text in a given area, or JScrollPaneShowingArrayOfJPanels which shows the result panels (it is also used as a billboard, thanks to JTextAreaWithCentredText).
EDIT:
I originally wrote FuzzyMatch as a bash function and I still use it to run commands without typing their whole name. I then re-coded it for Java and used word matching to do sentence matching using the same principle. I was testing FuzzyMatch at the beginning of January and finished 'FindDocuments' two days ago.