5 // Copyright (c) 2007-2008 Jiri Moudry, Pascal Craponne
\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
14 // The above copyright notice and this permission notice shall be included in
\r
15 // all copies or substantial portions of the Software.
\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
26 using System.Collections.Generic;
\r
27 using System.Globalization;
\r
29 namespace DbLinq.Language
\r
32 /// Words manipulation for a specific language.
\r
33 /// - Singularization/pluralization
\r
34 /// - Words extraction
\r
36 internal interface ILanguageWords
\r
39 /// using English heuristics, convert 'dogs' to 'dog',
\r
40 /// 'categories' to 'category',
\r
41 /// 'cat' remains unchanged.
\r
43 string Singularize(string plural);
\r
46 /// using English heuristics, convert 'dog' to 'dogs',
\r
47 /// 'bass' remains unchanged.
\r
49 string Pluralize(string singular);
\r
52 /// Extracts words from an undistinguishable letters magma
\r
53 /// for example "shipsperunit" --> "ships" "per" "unit"
\r
55 /// <param name="text">The text.</param>
\r
56 /// <returns></returns>
\r
57 IList<string> GetWords(string text);
\r
60 /// Returns true if the required culture is supported
\r
62 /// <param name="cultureInfo"></param>
\r
63 /// <returns></returns>
\r
64 bool Supports(CultureInfo cultureInfo);
\r
67 /// Loads the words (operation may be slow, so it is excluded from ctor)
\r