Code Monkey home page Code Monkey logo

cooklang-js's People

Contributors

azlekov avatar deathau avatar gordonped avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

colin-gourlay

cooklang-js's Issues

Timer duration parsing and localization

While working on the localization of your Obsidian plugin, I encountered an issue.

Timer units are parsed by checking only the first letter (thanks @seeyouspacecorgi for pointing that out). This works if the recipe is written in English, but it creates problems with other languages, ranging from unrecognized values (4%ore is not identified as 4 hours) to wrong values (4%Stunden would become 4 seconds instead of 4 hours).

I will gladly submit a patch, but we need to define what the acceptable values would be. The current implementation is lenient towards accepting weird values (4%minnites would work fine), while localization would necessarily require a finite list of values (for instance, s, second and seconds; it would become s, secondo and secondi in Italian, s, Sekunde and Sekunden in German, etc.), which could potentially break some of the existing recipes. While I would argue that such a recipe needs fixing anyway, the final word on this should not be mine.

Default ingredient amount is 1 instead of undefined

When no ingredient amount is specified, the parser assigns it a default value of 1, which can sometimes lead to nonsensical ingredient lists.

For example:

Then add @salt and @ground black pepper{} to taste.

becomes

  • 1 salt
  • 1 ground black pepper

when what I meant was to add some salt and some pepper

Would it be possible for the amount be some sort of undefined instead ?

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.