tristaaan / saythisnumber Goto Github PK
View Code? Open in Web Editor NEWParse numbers to a human language.
License: MIT License
Parse numbers to a human language.
License: MIT License
Or some equivalent linter.
Numbers become innaccurate in human readable language (confirmed in English), around the ten quadrillion mark:
Correct:
http://www.saythisnumber.in/english/1000000000000099
Expected result: One quadrillion and ninety nine
Actual result: One quadrillion and ninety nine
Incorrect:
http://www.saythisnumber.in/english/10000000000000099
Expected result: ten quadrillion and ninety nine
Actual result: ten quadrillion and one hundred
A few of the numbers in the English parser are not spelled correctly.
'ninty' -> 'ninety'
'fourty' -> 'forty'
This would be more useful as an npm module than an application with some endpoint.
Numbers 16 - 19 (and 26 - 29, 36 - 39, etc.) have wrong the spacing. Instead of 'diezyseis' it should be 'diez y seis', and the same thing for all the others. Starting from 200, it becomes 'cientos' instead of 'ciento', so from there it should be 'doscientos', 'doscientos uno', and so on, later 'trescientos', 'cuatrocientos' until 'quinientos' (where the bug is fixed). Then again 600 is broken (should be 'seiscientos', 'setecientos', 'ochocientos' and finally 'novecientos'.
maybe it's a bit silly.
1024 => 1️⃣0️⃣2️⃣4️⃣
Only integers are supported currently.
As specified by ISO 639-3
There is a different word for 500, it's not 'cinco cincuenta'
Would be nice to not only have a normal page output but also in json, csv, text.
Example:
2-5
two(newline)
three(newline)
four(newline)
five(newline)
two,three,four,five;
{[
"2" : "two",
"3" : "three",
"4" : "four",
"5" : "five",
]}
Can I do that?
Calling http://www.saythisnumber.in/english/4 everything goes well.
http://www.saythisnumber.in/english/4[a-z] will always get a header that it cannot GET this output.
But http://www.saythisnumber.in/english/4% will get the following error:
Error: Failed to decode param '4%' at Route.match (/app/node_modules/express/lib/router/route.js:65:17) at Router.matchRequest (/app/node_modules/express/lib/router/index.js:244:17) at pass (/app/node_modules/express/lib/router/index.js:104:30) at Router._dispatch (/app/node_modules/express/lib/router/index.js:173:5) at Object.router (/app/node_modules/express/lib/router/index.js:33:10) at next (/app/node_modules/express/node_modules/connect/lib/proto.js:194:15) at Object.expressInit as handle at next (/app/node_modules/express/node_modules/connect/lib/proto.js:194:15) at Object.query as handle at next (/app/node_modules/express/node_modules/connect/lib/proto.js:194:15)
To prevent or uncover bugs when when adding new languages or features. Build into package.json so npm test
No transliterations, sub in correct characters.
If the numbers get too big, there should be a warning / error instead of getting an undefined answer.
Example: http://saythisnumberin.herokuapp.com/english/1000000000000000000
is currently: "one undefined"
Right now this is specific for Chinese (Pinyin, Simplified, Traditional) and Japanese (Hiragana, Kanji, Romaji)
Perhaps choose a default and allow user to specify a different one?
say.thisNumber(32).in('chinese'); // => defaults to simplified(?)
say.thisNumber(32).in('chinese', 'pinyin');
This could be used to specify numeral systems of the language too?
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.