Giter Club home page Giter Club logo

wordfreq-rs's Introduction

wordfreq-rs

Documentation Crates.io

This library is a yet another Rust port of Python's wordfreq, allowing you to look up the frequencies of words in many languages.

Getting started

As with the original wordfreq, you can start looking for word frequencies right away.

use wordfreq_model::load_wordfreq;
use wordfreq_model::ModelKind;

fn main() {
    let wf_lgen = load_wordfreq(ModelKind::LargeEn).unwrap();
    let wf_lgfr = load_wordfreq(ModelKind::LargeFr).unwrap();

    println!("cafe(en) = {:?}", wf_lgen.word_frequency("cafe"));
    // => 1.2481286e-5
    println!("café(en) = {:?}", wf_lgen.word_frequency("café"));
    // => 5.705049e-6
    println!("cafe(fr) = {:?}", wf_lgfr.word_frequency("cafe"));
    // => 1.533655e-6
    println!("café(fr) = {:?}", wf_lgfr.word_frequency("café"));
    // => 5.8307935e-5
}

We recommend to first visit wordfreq-model for getting started because it allows you to load distributed models automatically. wordfreq-example will also be helpful to understand the behavior of this library.

The core API is provided by wordfreq.

Repository structure

This repository contains three crates:

  • wordfreq is a crate that provides an API to lookup word frequencies.
  • wordfreq-model is a crate that provides a loader for pre-compiled wordfreq models.
  • wordfreq-example is a crate that provides an example program.

Licensing

Licensed under either of

at your option.

The model files are distributed here together with the credits.

wordfreq-rs's People

Contributors

kampersanda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wordfreq-rs's Issues

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.