2008-11-12 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System.Data.Linq / src / DbLinq / Language / ILanguageWords.cs
1 #region MIT license\r
2 // \r
3 // MIT license\r
4 //\r
5 // Copyright (c) 2007-2008 Jiri Moudry, Pascal Craponne\r
6 // \r
7 // Permission is hereby granted, free of charge, to any person obtaining a copy\r
8 // of this software and associated documentation files (the "Software"), to deal\r
9 // in the Software without restriction, including without limitation the rights\r
10 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
11 // copies of the Software, and to permit persons to whom the Software is\r
12 // furnished to do so, subject to the following conditions:\r
13 // \r
14 // The above copyright notice and this permission notice shall be included in\r
15 // all copies or substantial portions of the Software.\r
16 // \r
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
23 // THE SOFTWARE.\r
24 // \r
25 #endregion\r
26 using System.Collections.Generic;\r
27 using System.Globalization;\r
28 \r
29 namespace DbLinq.Language\r
30 {\r
31     /// <summary>\r
32     /// Words manipulation for a specific language.\r
33     /// - Singularization/pluralization\r
34     /// - Words extraction\r
35     /// </summary>\r
36     internal interface ILanguageWords\r
37     {\r
38         /// <summary>\r
39         /// using English heuristics, convert 'dogs' to 'dog',\r
40         /// 'categories' to 'category',\r
41         /// 'cat' remains unchanged.\r
42         /// </summary>\r
43         string Singularize(string plural);\r
44 \r
45         /// <summary>\r
46         /// using English heuristics, convert 'dog' to 'dogs',\r
47         /// 'bass' remains unchanged.\r
48         /// </summary>\r
49         string Pluralize(string singular);\r
50 \r
51         /// <summary>\r
52         /// Extracts words from an undistinguishable letters magma\r
53         /// for example "shipsperunit" --&gt; "ships" "per" "unit"\r
54         /// </summary>\r
55         /// <param name="text">The text.</param>\r
56         /// <returns></returns>\r
57         IList<string> GetWords(string text);\r
58 \r
59         /// <summary>\r
60         /// Returns true if the required culture is supported\r
61         /// </summary>\r
62         /// <param name="cultureInfo"></param>\r
63         /// <returns></returns>\r
64         bool Supports(CultureInfo cultureInfo);\r
65 \r
66         /// <summary>\r
67         /// Loads the words (operation may be slow, so it is excluded from ctor)\r
68         /// </summary>\r
69         void Load();\r
70     }\r
71 }