Skip to content

About

Java Swing application for linguistic text processing, search, and XML export using OpenNLP.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

LingSearch Application

A Java Swing desktop application for linguistic text processing, search, and XML export.

📌 Overview

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.


🎯 Project Goals

The application implements the following core functionality:

✔ Load Text

  • Load from local files
  • Load from Wikipedia URLs (via Jsoup)
  • Clean and extract only article text (remove menus, tables, references, footnotes)

✔ Linguistic Processing (OpenNLP)

  • Sentence detection
  • Tokenization
  • POS tagging
  • Lemmatization
  • Language detection (optional)

✔ Search

Search processed text by:

  • Word (exact match)
  • Lemma
  • POS tag

Options:

  • Case sensitive / insensitive
  • Return full sentence
  • OR X tokens left / Y tokens right

✔ XML Export

  • Save all search results from the session
  • User chooses file name + location
  • XML structure includes query type, sentence, left/right context

✔ Executable JAR

  • Packaged with Maven
  • Includes all dependencies (OpenNLP, Jsoup)
  • Runs as a standalone desktop application

🧩 Project Structure

The project is organized into clear packages:

1. gui/

Handles all Swing UI components.

  • GuiPreview — main window, buttons, fields, results area
  • FileChooserHelper — file selection dialog

2. scraper/

Loads text from files or Wikipedia.

  • WebScraper — fetches and cleans Wikipedia HTML
  • LocalFileLoader — reads local text files

3. processing/

Runs the OpenNLP pipeline.

  • TextProcessor — sentence detection, tokenization, POS tagging, lemmatization
  • OpenNLPModels — loads model files once and shares them

4. search/

Implements search logic.

  • SearchEngine — search by word, lemma, POS
  • SearchResult — stores one match
  • SessionResults — stores all results for XML export

5. xml/

Handles XML writing.

  • XMLWriter — saves session results into structured XML

6. model/

Data structures.

  • SentenceData — tokens, POS tags, lemmas, original sentence
  • ProcessedText — entire processed document

7. root/

Entry point.

  • Main — launches the GUI

8. util/

Helper classes.

  • ErrorHandler — user-friendly error messages
  • TextCleaner — cleans raw text before processing

👩‍💻 My Contribution

I contributed to the following parts of the project:

✔ GUI Package

  • Implemented the main Swing interface
  • Added buttons, input fields, result display
  • Connected GUI actions to backend logic
  • Implemented error handling and user-friendly messages

✔ util Package

  • Implemented helper classes for text cleaning and error handling
  • Ensured the GUI never shows raw exceptions

✔ JAR Packaging

  • 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

🚀 How to Run

Option 1: Run the JAR

java -jar LingSearch.jar

Option 2: Run from IntelliJ

  • Open the project
  • Build with Maven
  • Run Main.java

📚 Dependencies

  • Java 17+
  • Maven
  • OpenNLP
  • Jsoup
  • Swing (Java built-in)

📄 User Manual

A full user manual is included in the repository.


📜 License

This project was created for academic purposes.

About

Java Swing application for linguistic text processing, search, and XML export using OpenNLP.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages