- OpenJDK 11.0.18.
- Scala 2.13.10.
- Install Scala (Metals) extension if you are using VS Code.
- Clone this project:
https://github.com/h3d-longnsp/Bigram-boolean-search.git
. - Click the
Import build
prompt when open project or runMetals: Import Build
manually in the command palette (ctrl
+shift
+P
).
- Build the executable
jar
file for this project by open a terminal at the root folder and runsbt clean assembly
. - Or run the pre-built
bigram-boolean-search.jar
intarget/scala-2.13
by runningjava -jar bigram-boolean-search.jar
.
Option | Shortcut |
---|---|
Select a input folder | Alt+F + Alt+O |
Select an index file | Alt+F + Alt+L |
Display About dialog |
Alt+H + Alt+A |
Build Vocabulary | Alt+V |
Build index | Alt+B |
Search the selected query | Alt+E |
Save the index | Alt+S |
Clear the search fields | Alt+C |
Exit the program | Alt+F + Alt+P |
- Choose
File>Select Input Folder
to select an input folder. A select folder dialog will display for users to choose an input folder. - Users can verify the path in the
Input Folder
text box. If the path is true then click theBuild Vocab
button. A loading dialog will appeared and the vocabulary for both unigram and bigram will be built. When done, theVocabulary
text box will display the total tokens count and the tokens. - If users haven't chosen a input folder, click the
Build Vocab
button will display an error dialog to notify the users.
- Choose
File>Load Index File
to select an index file. A select file dialog will display for users to choose an index file. - Users can verify the path in the
Index File
text box. A loading dialog will appeared and the chosen index will be loaded, theIndex
text box will display the total tokens count and the tokens with theirs corresponding documents ID.
- If users haven't built a vocabulary, click the
Build Index
button will display an error dialog to notify the users. - When a vocabulary is built, the status label will change to green. Click the
Build Index
to build the index. A loading dialog will appeared and the index will be built. When done, theIndex
text box will display the total tokens count and the tokens with theirs corresponding documents ID.
-
To use search, users need to build an index file or load an existing one.
-
There are 5 options to search for. Select the needed option and enter the terms then click
Search!
button. The result will be displayed in theResult
text box. The query and the result count will be displayed in theQuery
text box. -
If a term/terms is empty, an error dialog will be displayed to notify the users.
-
Examples:
-
To save the present index, click the
Save button
. A save dialog will appeared and the users will choose the name and location to save the index.