Giter Site home page Giter Site logo

agate's People

Contributors

jbhannah avatar

Watchers

 avatar  avatar  avatar

agate's Issues

Testing and coverage

Test with RSpec and Travis-CI against all available Ruby versions, and use SimpleCov/Coveralls.io for coverage.

Extract HTML formatter to its own class

Create a class Agate::Formatter::HTML, have :formatter => :html be a default option with Agate::Parser, and load and run the specified formatter automatically in Agate::Parser#parse.

Command-line parser

Take input via command line (piped through echo or as an argument) and return formatted text.

Usage:

agate (-h|[-f|--format <format>] [-d|--delimiters <delimiters>] <string>)

Flags:

  • -d|--delimiters <delimiters> Specify delimiters to use for matching. Can be a single character or pair of characters wrapped around ruby characters (see #2).
  • -f|--format <format> Specify a format to return. Possible values for <format>:
    • html (see #3)
  • -h|--help Show usage information.

Pre-release cleanup

After all other issues in the v1.0.0 milestone have been resolved:

  • All builds passing on Travis-CI
  • 100% test coverage
  • 4.0 Code Climate score

Refactor tests

  • Test parser using plain text formatter (#12)
  • Test individual formatters
  • Test CLI
  • Minimize redundant options, use defaults unless it's necessary to explicitly specify

Only load desired formatters

Possibilities:

  • Lazily load requested formatter when instantiating a new Agate::Parser
  • Refactor so that a formatter is instantiated by user, and Agate::Parser is used internally

Custom delimiters

Allow user specification of custom delimiters to be used in matching Regexp (see #1) and as ruby parentheses (contents of rp element). Default to【 】.

String#chars returns an enumerator in Ruby 1.9

String#chars behaves differently in Ruby 1.9 from 2.0, returning an enumerator for use with a block instead of an array of characters. Breaks Agate::Parser at line 27:

undefined method `last' for #<Enumerator: "【】":chars>

Automatically generate furigana for text

Inspired by the furigana gem, but use a pure-Ruby implementation of or alternative to MeCab if possible, instead of needing to install and run an external binary. Add as an option to the parser and command-line (see #5).

Use regular expressions to match kanji followed by furigana

Unicode block property regex: \p{Hiragana}
Unicode block property regex: \p{Katakana}
Unicode block property regex: \p{Han}

(via) e.g.

/\p{Han}+【[\p{Hiragana}\p{Katakana}]+】/.match("勉強【べんきょう】します") # 勉強【べんきょう】

Language detection/abstraction

Detect the base language of the string being parsed to determine how to detect ruby characters. e.g. which regex to use: single character followed by delimited ruby text (all languages), or multiple characters followed by combined ruby text (e.g. Japanese kanji compounds).

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.