rowino / inflection-js Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/inflection-js
Automatically exported from code.google.com/p/inflection-js
What steps will reproduce the problem?
1. Passing curves to singularize gets you curf.
Original issue reported on code.google.com by [email protected]
on 17 Apr 2008 at 5:05
What steps will reproduce the problem?
1. trying to singularize a word that doesn't match any singularizing rules.
What is the expected output? What do you see instead?
Javascript error: this._singular_rules[x] doesn't have any properties: in
other words, we accessed a _singular_rules item past the end of the array.
What version of the product are you using? On what operating system?
-doesn't matter-
Please provide any additional information below.
-none-
Original issue reported on code.google.com by [email protected]
on 26 Sep 2007 at 4:34
What steps will reproduce the problem?
1. 'address'.singularize()
What is the expected output? What do you see instead?
'address' is expected
'addres' is returned
What version of the product are you using? On what operating system?
the most recent
Please provide any additional information below.
I added the following line into the singular rules to solve the issue:
[new RegExp('(address)$', 'gi'), '$1'],
Original issue reported on code.google.com by [email protected]
on 30 Apr 2013 at 6:39
1. Run .singularize() on a singular word (e.g. "word".singularize())
I expected to get "word" but instead inflection-js returns an object and not a
string.
What version of the product are you using? On what operating system?
I am using the latest version (r38) on Mac OSX with Google Chrome and Firefox.
In Firefox in returns "String { 0="w", 1="o", more...}" which is peculiar
Original issue reported on code.google.com by [email protected]
on 26 Jan 2011 at 2:15
What steps will reproduce the problem?
1. call "22".ordinalize()
2. see that it has not ordinalized the numbers in the string
3. frown.
What is the expected output? What do you see instead?
expected: "22nd"
got: "22"
What version of the product are you using? On what operating system?
latest download
Original issue reported on code.google.com by [email protected]
on 6 Sep 2011 at 11:29
What steps will reproduce the problem?
1. pluralize the word Leaf
2.
3.
What is the expected output? What do you see instead?
Expected: Leaves Actual: Leafs
What version of the product are you using? On what operating system?
r38 on W7
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 19 Jun 2014 at 8:44
String.pluralize() and String.singularize() return objects rather than strings
as "this" always points to an object, adding the toString() means we return a
String as expected.
Original issue reported on code.google.com by [email protected]
on 28 Oct 2011 at 3:21
Attachments:
The correct English plurals of "octopus" and "virus" are "octopuses" and
"viruses".
"Octopi" comes from a mistaken belief that "octopus" is a Latin word; it is
not, it's Greek. The Greek plural would be "octopedes", but the common plural
in English by biologists is "octopuses".
"Virus" is Latin, but is a mass noun in Classical Latin, and thus would never
be pluralized by a native speaker. It's also a neuter noun of the second
declension, and nouns in that class are so rare that there are no known
instances of one being pluralized in Classical Latin -- thus, no one knows what
the correct plural would have been even if "virus" could have been pluralized
in Latin.
In Neo-Latin, "virus" has three different plural forms, depending on what case
it's used in. These are "vira", "virorum", and "viris".
It should be noted that biologists continue to use "virus" as a mass noun in
English -- thus, "viruses" is only used when multiple strains are being spoken
of. ("We discovered several new viruses", but "That vial is full of virus".)
Original issue reported on code.google.com by [email protected]
on 23 Jan 2012 at 7:08
Looking at String.humanize() I think it could be (marginally) faster and
(arguably) prettier like so:
if(!String.prototype.humanize)
String.prototype.humanize=function(lowFirstLetter)
{
var str = this
.toLowerCase()
.replace(/_id|_ids/g, '')
.replace(/_/g, ' ');
if(!lowFirstLetter)str=str.capitalize();
return str;
};
Would you consider this change? If so, what is the proper channels to submit a
pull request?
Thanks!
David
Original issue reported on code.google.com by [email protected]
on 30 Nov 2010 at 2:49
What steps will reproduce the problem?
1.'miss'.singularize();
2.'pass'.singularize();
What is the expected output? What do you see instead?
Expected outputs are 'miss' and 'pass' respectively but instead, 'mis' and
'pas' are being returned.
What version of the product are you using? On what operating system?
r38 on Windows Vista
Original issue reported on code.google.com by [email protected]
on 11 Mar 2012 at 1:53
Testing for if(window) fails on node.js as window is undefined, using a typeof
check instead fixes this.
Original issue reported on code.google.com by [email protected]
on 28 Oct 2011 at 3:23
Attachments:
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.