deathau / cooklang-js Goto Github PK
View Code? Open in Web Editor NEWCookLang-JS is a TypeScript library for parsing CookLang.
License: MIT No Attribution
CookLang-JS is a TypeScript library for parsing CookLang.
License: MIT No Attribution
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.
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
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 ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.