Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

English #590

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,35 @@ This is kind of mixing `ToWords` with `Ordinalize`. You can call `ToOrdinalWords
121.ToOrdinalWords() => "hundred and twenty first"
```

###English Tense
There are a few methods that help manipulate English verbs.

####ToPast
`ToPast` converts a simple present verb into simple past taking irregular verbs into consideration:

```C#
"Test".ToPast() => "Tested"
"Cry".ToPast() => "Cried"
"Love".ToPast() => "Loved"

"Fly".ToPast() => "Flew"
"Freeze".ToPast() => "Froze"
"Grind".ToPast() => "Ground"
```

####ToPastParticiple
`ToPastParticiple` converts simple past to past participle taking irregular verbs into consideration:

```C#
"Test".ToPastParticiple() => "Tested"
"Cry".ToPastParticiple() => "Cried"
"Love".ToPastParticiple() => "Loved"

"Fly".ToPastParticiple() => "Flown"
"Freeze".ToPastParticiple() => "Frozen"
"Grind".ToPastParticiple() => "Ground"
```

###Mix this into your framework to simplify your life
This is just a baseline and you can use this to simplify your day to day job. For example, in Asp.Net MVC we keep chucking `Display` attribute on ViewModel properties so `HtmlHelper` can generate correct labels for us; but, just like enums, in vast majority of cases we just need a space between the words in property name - so why not use `"string".Humanize` for that?!

Expand Down
Loading