lembacon / hfst-ospell Goto Github PK
View Code? Open in Web Editor NEWThis project forked from hfst/hfst-ospell
HFST spell checker library and command line tool
License: Apache License 2.0
This project forked from hfst/hfst-ospell
HFST spell checker library and command line tool
License: Apache License 2.0
# Hfst-ospell library and toy commandline tester This is a minimal hfst optimized lookup format based spell checker library and a demonstrational implementation of command line based spell checker. The library is licenced under Apache licence version 2, other licences can be obtained from University of Helsinki. [![Build Status](https://travis-ci.org/hfst/hfst-ospell.svg?branch=master)](https://travis-ci.org/hfst/hfst-ospell) ## Dependencies - libxml++2 - libarchive ## Debian packages for dependencies - libxml++2-dev - libarchive-dev ## Usage Usage in external programs: #include <ospell.h> and compile your project with: $(pkg-config --cflags hfstospell) and link with: $(pkg-config --libs hfstospell) ## Programming examples The library lives in a namespace called hfst_ospell. Pass (weighted!) Transducer pointers to the Speller constructor, eg.: FILE * error_source = fopen(error_filename, "r"); FILE * lexicon_file = fopen(lexicon_filename, "r"); hfst_ospell::Transducer * error; hfst_ospell::Transducer * lexicon; try { error = new hfst_ospell::Transducer(error_source); lexicon = new hfst_ospell::Transducer(lexicon_file); } catch (hfst_ospell::TransducerParsingException& e) { /* problem with transducer file, usually completely different type of file - there's no magic number in the header to check for this */ } hfst_ospell::Speller * speller; try { speller = new hfst_ospell::Speller(error, lexicon); } catch (hfst_ospell::AlphabetTranslationException& e) { /* problem with translating between the two alphabets */ } And use the functions: // returns true if line is found in lexicon bool hfst_ospell::Speller::check(char * line); // CorrectionQueue is a priority queue, sorted by weight hfst_ospell::CorrectionQueue hfst_ospell::Speller::correct(char * line); to communicate with it. See main.cc for a concrete usage example. ## Command-line tool Main.cc provides a demo utility with the following help message: Usage: hfst-ospell [OPTIONS] ERRORSOURCE LEXICON Run a composition of ERRORSOURCE and LEXICON on standard input and print corrected output -h, --help Print this help message -V, --version Print version information -v, --verbose Be verbose -q, --quiet Don't be verbose (default) -s, --silent Same as quiet Report bugs to [email protected] # Use in real-world applications The HFST based spellers can be used in real applications with help of [voikko](http://voikko.sf.net). Voikko in turn can be used with enchant, libreoffice, and firefox.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.