Giter VIP home page Giter VIP logo

hyphenatorx's People

Contributors

wendellavila avatar xerik avatar

Watchers

 avatar

hyphenatorx's Issues

Provide documation for locale Strings

This enum is a little bit hidden. Please add more documentation.

enum Language { language_af,language_as,language_bg,language_bn,language_ca,language_cop,language_cs,language_cy,language_da,language_de_1901,language_de_1996,language_de_ch_1901,language_el_monoton,language_el_polyton,language_en_gb,language_en_us,language_eo,language_es,language_et,language_eu,language_fi,language_fr,language_fur,language_ga,language_gl,language_grc,language_gu,language_hi,language_hr,language_hsb,language_hu,language_hy,language_ia,language_id,language_is,language_it,language_ka,language_kmr,language_kn,language_la_x_classic,language_la,language_lt,language_lv,language_ml,language_mn_cyrl_x_lmc,language_mn_cyrl,language_mr,language_mul_ethi,language_nb,language_nl,language_nn,language_or,language_pa,language_pl,language_pms,language_pt,language_rm,language_ro,language_ru,language_sa,language_sh_cyrl,language_sk,language_sl,language_sv,language_ta,language_te,language_th,language_tk,language_tr,language_uk,language_zh_latn_pinyin }

For German locale you have to use de_1996 for example, not DE_de what I would have expected.

Besides that, looking promising for German!!!

Cast exception when using German and Swiss German language files

There is a cast exception in hyphenatorx.dart when using Language_de_ch_1901or Language_de_1996 (didn't try any other).

image

The reason seems to be that German languages do not define any exceptions (hyphenatorx.dart).
image

i.e. config.data["exception"] is an empty map
image

A fix would be:

    if (config.data['exception'] is Map &&
        (config.data['exception'] as Map).isNotEmpty) {
      exceptions.addEntries(
        (config.data['exception'] as Map<String, dynamic>)
            .entries
            .map((entry) => MapEntry(entry.key, List<int>.from(entry.value))),
      );
    }

In the meantime it works with the following (super ugly) hack:

static final hyphenator = Hyphenator(
      Language_de_ch_1901()
        ..data["exception"] = {
          "test": [1]
        },
      symbol: '_');

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.