This project is a Java-based (or Kotlin-compatible) command line tool that searches for words in a dictionary file (wordlist.txt) based on a query composed of multiple rules.
Each rule represents a constraint, and all rules are combined using logical AND to filter matching words.
The design is extensible, allowing new rules to be added easily without modifying the core search logic.
The tool reads words from:
wordlist.txt
It then filters words using a word query, where a query consists of one or more rules.
Each rule is provided as a single command-line argument in the format:
key=value
All rules must be satisfied for a word to be included in the output.
class={isogram|palindrome|semordnilap} isogram → No repeated characters in the word palindrome → Word reads the same forwards and backwards semordnilap → Word whose reverse is a different valid word in the dictionary
maxlength= minlength= maxlength → Maximum allowed length minlength → Minimum allowed length
startswith= endswith= containsonly= startswith → Word must start with given prefix endswith → Word must end with given suffix containsonly → Word can only contain given characters
- Palindromes up to 8 characters class=palindrome maxlength=8
- Words of exactly 3 letters maxlength=3 minlength=3
- Words starting with "ba" startswith=ba
- Words using only specific letters containsonly=abcde
- Multiple rules combined (AND logic) class=palindrome minlength=4 maxlength=10
From project root:
mvn clean compile mvn exec:java -Dexec.mainClass=org.wordsearch.Main -Dexec.args="class=palindrome maxlength=8"
Build project:
mvn package
Run:
java -cp target/wordsearch-1.0-SNAPSHOT.jar org.wordsearch.Main class=palindrome maxlength=8