Git Product home page Git Product logo

paragraph_generator's Introduction

https://travis-ci.com/eric-s-s/paragraph_generator.svg?branch=master https://coveralls.io/repos/github/eric-s-s/paragraph_generator/badge.svg?branch=master

paragraph_generator v3.1

A micro-service component for an English Language Learners website

This is the basic back-end entry points for a service that creates a paragraph with specific kinds of errors for ELL students (especially Mandarin Chinese speakers) to practice basic proof reading. It is installable using pip and provides objects and functions for generating jsons and python objects. This should then be easy to plug into almost any server.

To install:

$ pip install git+https://github.com/eric-s-s/paragraph_generator

or:

$ git clone https://github.com/eric-s-s/paragraph_generator
$ cd sentences
$ python setup.py install  # or pip install .

Basic Documentation:

class:

AnswerChecker

method __init__:
types:{'submission': <class 'str'>, 'original': <class 'paragraph_generator.word_groups.paragraph.Paragraph'>}
method count_sentence_errors:
types:{'return': <class 'int'>}
method count_word_errors:
types:{'return': <class 'int'>}
method get_sentence_hints:
docs:
return:{'error_count': int, 'hint_paragraph': str, 'missing_sentences': int}
method get_word_hints:
docs:
return:{'error_count': int, 'hint_paragraph': str, 'missing_sentences': int}
method is_submission_correct:
types:{'return': <class 'bool'>}
method original:
method submission:
class:

WordLists

method __init__:
docs:
param verbs:{'verb': str, 'irregular_past': str, 'preposition': str, 'particle': str, 'objects': int}
param countable:{'noun': str, 'irregular_plural': str}
param uncountable:{'noun': str, 'definite': bool}
param static:{'noun': str, 'is_plural': bool}
method nouns:
method verbs:
class:

ParagraphsGenerator

method __init__:
types:{'word_lists_generator': <class 'paragraph_generator.word_lists.AbstractWordLists'>}
docs:

config_state optional keys:

  • 'error_probability': 0.0 <= float <= 1.0
  • 'noun_errors': bool
  • 'pronoun_errors': bool
  • 'verb_errors': bool
  • 'is_do_errors': bool
  • 'preposition_transpose_errors': bool
  • 'punctuation_errors': bool
  • 'tense': str - 'simple_past'|'simple_present'
  • 'probability_plural_noun': 0.0 <= float <= 1.0
  • 'probability_negative_verb': 0.0 <= float <= 1.0
  • 'probability_pronoun': 0.0 <= float <= 1.0
  • 'paragraph_type': str - 'chain'|'pool'
  • 'subject_pool': 0 < int
  • 'paragraph_size': 0 < int
method generate_paragraphs:
types:{'return': typing.Tuple[paragraph_generator.word_groups.paragraph.Paragraph, paragraph_generator.word_groups.paragraph.Paragraph]}
docs:
return:answer, error
method get:
method get_nouns:
types:{'return': typing.List[paragraph_generator.words.noun.Noun]}
method get_verbs:
types:{'return': typing.List[paragraph_generator.word_groups.verb_group.VerbGroup]}
class:

Serializer

method __init__:
docs:No __init__ method. All methods are class methods or static methods
method from_json:
method to_dict:
method to_json:
method to_obj:

paragraph_generator's People

Contributors

eric-s-s avatar

Watchers

 avatar  avatar

paragraph_generator's Issues

change "set" to something else

calling methods with "set" seems inaccurate as they don't actually set anything but make new objects. some re-naming might be in order

copying where unneeded

in sentence:

class Sentence(object):
    def __init__(self, word_list: WordList = None):
        if word_list is None:
            word_list = []
        self._word_list = word_list.copy()

don't use "copy"

in paragraph/tags/ i believe the "copy" method is utter redundant.

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.