Skip to content

ShqiW/AutoCompletion-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Auto Completion Library

Introduction

The auto-completion library (ACL) has a set of English words (alpha words, i.e., words that contain characters only no symbols and/or numbers) that are used to provide possible auto-completions. This library are based on Trie data structure.

Function

  • Add new word
  • Remove word
  • Get auto-completion by providing a given prefix

Installation

Gradle

Add this to build file(build.gradle)

dependencies {
    implementation 'io.github.ShqiW:AutoCompletion:0.1.1'
}

Maven

Add this to pom.xml

<dependency>
    <groupId>io.github.ShqiW</groupId>
    <artifactId>AutoCompletion</artifactId>
    <version>0.1.1</version>
</dependency>

Quick Start

// import library
import autocomplete.AutoCompletion;

// Create an instance
AutoComplete autoComplete = new AutoComplete();

// Add words
autoComplete.addWord("hello");
autoComplete.addWord("help");

// Get completions
List<String> completions = autoComplete.getCompletions("hel");
// Returns: ["hello", "help" ...]

Development Guide

Prerequisites

  • JDK: 11+
  • Gradle: 7.x

Build from github repo

  1. Clone the repository
git clone https://github.com/CS6510-SEA-SP25/hw1-ShqiW.git
cd hw1-ShqiW
  1. Build the project
./gradlew build

Run test

# Run all tests
./gradlew test 

# Generate coverage report
./gradlew jacocoTestRespot

Generate Documentation

Generate Javadoc

./gradlew javadoc

Code quality check

Run quality check

# Checkstyle(Coding Style Check)
./gradlew checkstyleMain checksyleTest

# PMD(Static Code Analysis)
./gradlew pmdMain pmdTest

# SpotBugs(Static Code Analysis)
./gradlew spotbugMain spotbugTest

Generate JAR package

To generate the JAR package, run:

./gradlew jar

Find Reports

  • Jacoco test coverage: build/reports/jacoco/test/html/jacoco-resources/index.html
  • Checkstyle: build/reports/checkstyle
  • PMD: build/reports/pmd
  • SpotBugs: build/reports/spotbugs
  • Javadoc: build/doc/javadoc/autocomplete

Author

Shenqian Wen

Links

About

CS6510 Homework1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages