Git Product home page Git Product logo

wrant's Introduction

wrant

Writing Assistant

A simple tool to find collocations of words in a given corpus. Useful for finding correct word usages and checking up phrases.

Requires python 3.X

Clone

git clone https://github.com/fm2g11/wrant.git
cd wrant

Prerequisites

You need to put some plain text files in data/books, ideally books of the same genre to what you want to check.

Install

make install  # will install requirements
make build    # will build a corpus based on the books you put in data/books

Run

from wrant import Wrant
wrant = Wrant()
wrant.concordance('stirrup')
wrant.concordance('scratched * back')  # * is a wild character for a single token
wrant.concordance('scratched', context=['back'])  # This means 'back' has to be somewhere around 'scratched'

Arguments

Wrant.concordance(
    text,
    width=90,
    lines=25,
    lemma=True,
    context=[],
    context_size=5
)
  • text: The piece of text to search for. Typically a word or an expression.
  • width: The number of characters to show for each results.
  • lemma: Whether to match on lemmas or original tokens. Applies to context too.
  • context: A list of words that needs to occur near the text.
  • context_size: Number of words (both left and right) from the text in which context applies to.

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.