Skip to content

Irregular inflector behavior #110

Description

@escobera

Hello there,

I have these rules (among others) in my app.

inflector.irregular('arma-branca', 'armas-brancas');
inflector.irregular('acessorio-arma-branca', 'acessorios-armas-brancas');

With this config I get this result:
selection_006

It seems the second irregular rule is never met, this line looks like the culprit. It checks for the end of the rule, so, strings ending the same way can respond wrongly.

Another thing I notice is that this code makes the irregular declaration order specific. If I invert the order like so:

inflector.irregular('acessorio-arma-branca', 'acessorios-armas-brancas');
inflector.irregular('arma-branca', 'armas-brancas');

I get the right result:
selection_007

Can we make the irregulars check for the whole expression first?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions