Code Monkey home page Code Monkey logo

pyinflect's People

Contributors

axiomabsolute avatar bjascob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pyinflect's Issues

Python2 setup small issue

There's a problem with the file encoding 'InflectionRules.py'
I just added this so that setup.py works
# -*- coding: utf-8 -*-

Allow to use custom infl.csv and overrides.csv files

It would be great to be able to extend the infl.csv and overrides.csv files, e.g. a word is missing, so it can just be appended it to the file. So one way this could be possible, if I could specify paths to those files and keep them somewhere accessible and not untouchable in the library folder.
Currently, it's not exactly supported. When I tried to initialize manually the Inflections object, I got an error. But maybe I'm just doing something wrong.

Code:

import spacy
from pyinflect import Inflections

nlp = spacy.load('en_core_web_sm')
inflections = Inflections('path/to/infl.csv', overrides_fn='path/to/overrides.csv')

Error:

ValueError: [E090] Extension 'inflect' already exists on Token. To overwrite the existing extension, set `force=True` on `Token.set_extension`.

Some suggestions

Heya,

Like the new version! :)

Some quick suggestions:

  1. To make it easier to use, I'd list all the valid POS tags and their meanings in the readme. Some people might not be familiar with PTB tags or what the package can generate.

  2. If you have time, I also think it'd be nice if getAllInflections returned a dictionary rather than a list: E.g. {"VB": ("eat"), "VBZ": ("eats"), ...}. That way, we could also see all the forms that are available. It's true you can generally infer this from the position of the tuple in the list, but I think it'd be good to make it explicit.

With this in mind, I've attached the code I wrote previously to convert the infl.txt into JSON format with POS tags: new_agid.zip
I think working from this file should also bypsas most of the other issues you have with overrides.

  1. I also thought you were going to make the pos_type argument optional in getAllInflections. So you can specify V, A or N, but also leave it blank if you want to see all options;
    E.g.
> getAllInflections("watch")
{"NN": ("watch"), "VB": ("watch"), ...}

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.