Git Product home page Git Product logo

spell_check's Introduction

Spellchecker

Simple spellcheck package in go

git clone https://github.com/foglar/spell_check.git

Example usage

There are already bundled some wordlist, words.txt (EN dictionary), words_alpha.txt (EN dictinary alphabet) and czech.txt (CZ dictionary).

package main

import (
 "fmt"
 "github.com/foglar/spell_check/"
 "log"
)

func main() {
 sc, err := spellchecker.NewSpellChecker("./words.txt")
 if err != nil {
  log.Fatalf("Error creating SpellChecker: %v", err)
 }

 word := "exprezzion"
 closestWords := sc.Check(word, 10)

 fmt.Printf("Closest words to '%s': %v\n", word, closestWords)
}

Performace

  • wordlists are ordered alphabeticly
  • CPU: AMD Ryzen 7 5825U with Radeon Graphics (16) @ 4.546GHz

words.txt pneumonoultramicroscopicsilicovolcanoconiosis

Test Case Real Time User Time Sys Time
performance 1,297s 1,660s 0,232s
power saver 3,823s 4,739s 0,533s
balanced 1,942s 2,485s 0,282s

words_alpha.txt pneumonoultramicroscopicsilicovolcanoconiosis

Test Case Real Time User Time Sys Time
performance 1,059s 1,338s 0,227s
balanced 1,554s 1,955s 0,272s
power saver 3,085s 3,863s 0,443s

words.txt ad

Test Case Real Time User Time Sys Time
performance 0,308s 0,374s 0,151s
power saver 0,322s 0,368s 0,178s
balanced 0,318s 0,384s 0,145s

words_alpha.txt ad

Test Case Real Time User Time Sys Time
performance 0,331s 0,371s 0,198s
balanced 0,422s 0,508s 0,258s
power saver 0,779s 0,922s 0,342s

Reference

spell_check's People

Contributors

foglar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.