Questions tagged [pluralize]

Pluralize stands for an automate script process, that checks a word (for example, english word "box") and adds its plural end "es", so it comes "boxes", when it is needed to be plural. Term is used in many programming languages.

146 questions
0
votes
1 answer

Refactoring a simple script to clean a mysql database in ruby

I created the following script to wipe a mysql database (and reset the primary keys of each table). I'm wondering how I should refactor it, and how I could pull in pluralize from ActiveSupport. Code: MODEL_DIR =…
Senjai
  • 1,811
  • 3
  • 20
  • 40
0
votes
1 answer

rails3 view has_many :through attribute

Three models linked via has_many :through class Bozza < ActiveRecord::Base has_many :accessoryvolumes, :dependent => :destroy has_many :accessories, through: :accessoryvolumes belongs_to :lavorazione class Accessory < ActiveRecord::Base …
Jerome
  • 5,583
  • 3
  • 33
  • 76
0
votes
1 answer

Pluralization service in Entity Framework - Visual Studio 2008?

Does any one know if there is kinda implementation/addon for VS 2008 SP1 for pluralization service in entity framework like there is gonna b in vs 2010? example: In database: Entity Order ---OrderId ---CustomerId ---OrderDate Entity Customer …
0
votes
1 answer

Get the name of the entity from the view - preferably plural name

My view takes in the entity directly as the model: @model MyProject.Models.MyEntity Is there an easy way to get the plural name of the entity within the view? In the above example, I would want MyEntities. I know I can do this in a helper, or in…
PeteGO
  • 5,597
  • 3
  • 39
  • 70
0
votes
1 answer

Rails Controller not picking up matching models and methods

So my Rails controller isn't working (properly) for some reason. I first noticed something funny when I opened the controller file for the first time. Compare this to normal syntax highlighting. (Also notice the overly long name) This was the…
ovatsug25
  • 7,786
  • 7
  • 34
  • 48
-1
votes
1 answer

So I am trying to pluralize my pennies but it keeps failing my pipeline

Trying to get the following to pass my pipeline it is failing to pluralize. The rest of the change passed the pipeline just can't seem to get the pennies to pass. Help with this would be greatly appreciated. I have tried everything I could think of…
Lynn
  • 1
  • 3
-1
votes
1 answer

Kotlin: Pluralize amount of currency

I want to write some code to determine if I need to write "Quarter" or "Quarters" depending on the amount. Up to now I have the following code: fun main(args: Array) { var changeDue = 1.22; Change(changeDue); } fun Change(changeDue:…
Lynn
  • 1
  • 3
-1
votes
3 answers

How can I combine two functions using default value?

I would like to combine these two function but I'm on trouble how to do it. Could anyone help me please? fun String?.pluralize(count: Int): String? { return if (count != 1) { this + 's' } else { this } } fun…
John
  • 17
  • 1
  • 8
-1
votes
2 answers

JAVA get Plural/Singular for a given String/Word

trying to match a word with some hard coded values, let's say i have this word 'revenue' but 'revenues' should also be a match.same way like this 'liability' > 'liabilities' . what would be the approach we should take here, thanks in advance. I…
krsna
  • 41
  • 6
-1
votes
1 answer

Pluralize string in Symfony 3

Are there any ways for pluralizing a string in Symfony 3? For example: I have "Object" and I would like to get "Objects".
-1
votes
1 answer

Text direction and pluralization dataset

I am working on a Ruby on Rails project, in which I need to get the text direction and the plural form for different languages. Something like: en: { plural_keys: [:one, :other], text_dir: :left_to_right }, sk: { plural_keys: [:one, :few, :other],…
1 2 3
9
10