Nov 23
ActionScript 3 Inflector class for pluralizing and singularizing words
The as3 Inflector class can be used to pluralize or singularize most words. It is essentially a direct port of the Rails inflector class.
Here is a little demo Flex app that I put together to demo the classes functionality.
You can right click on the app to view the source and grab the class, or you can just click here.


November 23rd, 2007 at 9:57 pm
Dude your bringing all the goodness from Rails to flex
keep it up and make a Lib! Well done
November 24th, 2007 at 1:22 am
Have you looked at the Perl version? Seems a bit more comprehensive.
http://search.cpan.org/dist/Lingua-EN-Inflect/lib/Lingua/EN/Inflect.pm
December 2nd, 2007 at 1:10 am
[...] http://flexonrails.net/?p=101 [...]
January 10th, 2008 at 3:43 pm
Very nice! Still needs a bit of tweaking, though. For example, when I typed “German” in the singular text input and clicked “Pluralize”, it printed out “Germen”.
January 14th, 2008 at 2:27 pm
Try pluralizing ‘flex’
January 28th, 2008 at 12:20 pm
[...] casing, underscoring, and humanizing words. I did search for and find an existing inflection class but I decided to port the CakePHP inflector which is more extensive and more accurate. Download [...]
January 29th, 2008 at 2:51 pm
plural of goose? gooses? Still, nice work…
February 2nd, 2008 at 12:57 pm
It has the same funny bug as Rails had – http://dev.rubyonrails.org/ticket/10919.
Waiting for an enhancement ;D
February 6th, 2008 at 9:49 pm
@m4chu
That must be the funniest bug report that I’ve ever read.
September 26th, 2008 at 12:06 pm
Getting the following with the latest flex3 mxmlc & the downloaded code. Any ideas what this means? Still produces a working SWF.
$ mxmlc –version
Version 3.1.0 build 2710
$ mxmlc InflectorExample.mxml
Loading configuration file /opt/local/flex_sdk_3/frameworks/flex-config.xml
/Users/jordan/Downloads/InflectorExample/com/rxr/currents/util/Inflector.as(35): col: 4: Warning: flex2.compiler.as3.SignatureExtension.SignatureGenerationFailed[level='warning', column='4', node='LabeledStatement', line='35', cause='flex2.compiler.as3.SignatureAssertionRuntimeException: Unreachable Codepath
at flex2.compiler.as3.SignatureEvaluator.ASSERT(SignatureEvaluator.java:369)
at flex2.compiler.as3.SignatureEvaluator.UNREACHABLE_CODEPATH(SignatureEvaluator.java:357)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:1708)
at macromedia.asc.parser.LabeledStatementNode.evaluate(LabeledStatementNode.java:47)
at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:338)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:1795)
at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:530)
at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:106)
at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:338)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:1795)
at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:454)
at macromedia.asc.parser.ProgramNode.evaluate(ProgramNode.java:80)
at flex2.compiler.as3.SignatureExtension.generateSignature(SignatureExtension.java:270)
at flex2.compiler.as3.SignatureExtension.doSignatureGeneration(SignatureExtension.java:174)
at flex2.compiler.as3.SignatureExtension.parse1(SignatureExtension.java:137)
at flex2.compiler.as3.Compiler.parse1(Compiler.java:369)
', path='/Users/jordan/Downloads/InflectorExample/com/rxr/currents/util/Inflector.as']
static:{
^
/Users/jordan/Downloads/InflectorExample/InflectorExample.swf (233274 bytes)
May 3rd, 2009 at 2:44 pm
I had a similar to the one above error. I turned out I had accidently used instead of . Looks very scary but turned out to be very simple for me.
May 3rd, 2009 at 2:45 pm
I had a similar to the one above error. I turned out I had accidently used Script tag instead of a Style tag. Looks very scary but turned out to be very simple for me.