How to program with PluralizationService in

Posted by Rajnilari2015 under VB.NET category on | Points: 40 | Views : 1905
Class Program
Private Shared Sub Main(args As String())
'creates an instance of the service
Dim ps As PluralizationService = PluralizationService.CreateService(CultureInfo.GetCultureInfo("en-us"))

'check if the supplied word is plural
Dim isPlural = ps.IsPlural("mangoes")
'check if the supplied word is singular
Dim isSingular = ps.IsSingular("mangoe")
'change a singular word to plural
Dim pluralWord = ps.Pluralize("boy")
'result: boys
'change a plural word to singular
Dim singularWord = ps.Singularize("girls")
'result: girl

End Sub
End Class

Comments or Responses

Login to post response