A Java Swing desktop application for linguistic text processing, search, and XML export.
LingSearch is a standalone Java application designed to load text from local files or Wikipedia URLs, process it using OpenNLP, and allow users to search by word, lemma, or POS tag.
The application displays results in context and supports exporting all search results into a structured XML file.
This project was developed as part of a group assignment in computational linguistics.
The application implements the following core functionality:
- Load from local files
- Load from Wikipedia URLs (via Jsoup)
- Clean and extract only article text (remove menus, tables, references, footnotes)
- Sentence detection
- Tokenization
- POS tagging
- Lemmatization
- Language detection (optional)
Search processed text by:
- Word (exact match)
- Lemma
- POS tag
Options:
- Case sensitive / insensitive
- Return full sentence
- OR X tokens left / Y tokens right
- Save all search results from the session
- User chooses file name + location
- XML structure includes query type, sentence, left/right context
- Packaged with Maven
- Includes all dependencies (OpenNLP, Jsoup)
- Runs as a standalone desktop application
The project is organized into clear packages:
Handles all Swing UI components.
- GuiPreview — main window, buttons, fields, results area
- FileChooserHelper — file selection dialog
Loads text from files or Wikipedia.
- WebScraper — fetches and cleans Wikipedia HTML
- LocalFileLoader — reads local text files
Runs the OpenNLP pipeline.
- TextProcessor — sentence detection, tokenization, POS tagging, lemmatization
- OpenNLPModels — loads model files once and shares them
Implements search logic.
- SearchEngine — search by word, lemma, POS
- SearchResult — stores one match
- SessionResults — stores all results for XML export
Handles XML writing.
- XMLWriter — saves session results into structured XML
Data structures.
- SentenceData — tokens, POS tags, lemmas, original sentence
- ProcessedText — entire processed document
Entry point.
- Main — launches the GUI
Helper classes.
- ErrorHandler — user-friendly error messages
- TextCleaner — cleans raw text before processing
I contributed to the following parts of the project:
- Implemented the main Swing interface
- Added buttons, input fields, result display
- Connected GUI actions to backend logic
- Implemented error handling and user-friendly messages
- Implemented helper classes for text cleaning and error handling
- Ensured the GUI never shows raw exceptions
- Configured Maven build
- Packaged the application into a runnable JAR
- Ensured all dependencies and resources were included
- Verified the JAR runs correctly on different machines
java -jar LingSearch.jar
- Open the project
- Build with Maven
- Run
Main.java
- Java 17+
- Maven
- OpenNLP
- Jsoup
- Swing (Java built-in)
A full user manual is included in the repository.
This project was created for academic purposes.