strings.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <?php
  2. return array(
  3. /*
  4. |--------------------------------------------------------------------------
  5. | String Inflection
  6. |--------------------------------------------------------------------------
  7. |
  8. | This array contains the singular and plural forms of words. It's used by
  9. | the "singular" and "plural" methods in the Str class to convert a given
  10. | word from singular to plural and vice versa.
  11. |
  12. | Note that the regular expressions are only for inflecting English words.
  13. | To inflect a non-English string, simply add its singular and plural
  14. | form to the array of "irregular" word forms.
  15. |
  16. */
  17. 'plural' => array(
  18. '/(quiz)$/i' => "$1zes",
  19. '/^(ox)$/i' => "$1en",
  20. '/([m|l])ouse$/i' => "$1ice",
  21. '/(matr|vert|ind)ix|ex$/i' => "$1ices",
  22. '/(x|ch|ss|sh)$/i' => "$1es",
  23. '/([^aeiouy]|qu)y$/i' => "$1ies",
  24. '/(hive)$/i' => "$1s",
  25. '/(?:([^f])fe|([lr])f)$/i' => "$1$2ves",
  26. '/(shea|lea|loa|thie)f$/i' => "$1ves",
  27. '/sis$/i' => "ses",
  28. '/([ti])um$/i' => "$1a",
  29. '/(tomat|potat|ech|her|vet)o$/i' => "$1oes",
  30. '/(bu)s$/i' => "$1ses",
  31. '/(alias)$/i' => "$1es",
  32. '/(octop)us$/i' => "$1i",
  33. '/(ax|test)is$/i' => "$1es",
  34. '/(us)$/i' => "$1es",
  35. '/s$/i' => "s",
  36. '/$/' => "s"
  37. ),
  38. 'singular' => array(
  39. '/(quiz)zes$/i' => "$1",
  40. '/(matr)ices$/i' => "$1ix",
  41. '/(vert|ind)ices$/i' => "$1ex",
  42. '/^(ox)en$/i' => "$1",
  43. '/(alias)es$/i' => "$1",
  44. '/(octop|vir)i$/i' => "$1us",
  45. '/(cris|ax|test)es$/i' => "$1is",
  46. '/(shoe)s$/i' => "$1",
  47. '/(o)es$/i' => "$1",
  48. '/(bus)es$/i' => "$1",
  49. '/([m|l])ice$/i' => "$1ouse",
  50. '/(x|ch|ss|sh)es$/i' => "$1",
  51. '/(m)ovies$/i' => "$1ovie",
  52. '/(s)eries$/i' => "$1eries",
  53. '/([^aeiouy]|qu)ies$/i' => "$1y",
  54. '/([lr])ves$/i' => "$1f",
  55. '/(tive)s$/i' => "$1",
  56. '/(hive)s$/i' => "$1",
  57. '/(li|wi|kni)ves$/i' => "$1fe",
  58. '/(shea|loa|lea|thie)ves$/i' => "$1f",
  59. '/(^analy)ses$/i' => "$1sis",
  60. '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => "$1$2sis",
  61. '/([ti])a$/i' => "$1um",
  62. '/(n)ews$/i' => "$1ews",
  63. '/(h|bl)ouses$/i' => "$1ouse",
  64. '/(corpse)s$/i' => "$1",
  65. '/(us)es$/i' => "$1",
  66. '/(us|ss)$/i' => "$1",
  67. '/s$/i' => "",
  68. ),
  69. 'irregular' => array(
  70. 'child' => 'children',
  71. 'foot' => 'feet',
  72. 'goose' => 'geese',
  73. 'man' => 'men',
  74. 'move' => 'moves',
  75. 'person' => 'people',
  76. 'sex' => 'sexes',
  77. 'tooth' => 'teeth',
  78. ),
  79. 'uncountable' => array(
  80. 'audio',
  81. 'equipment',
  82. 'deer',
  83. 'fish',
  84. 'gold',
  85. 'information',
  86. 'money',
  87. 'rice',
  88. 'police',
  89. 'series',
  90. 'sheep',
  91. 'species',
  92. 'moose',
  93. 'chassis',
  94. 'traffic',
  95. ),
  96. /*
  97. |--------------------------------------------------------------------------
  98. | ASCII Characters
  99. |--------------------------------------------------------------------------
  100. |
  101. | This array contains foreign characters and their 7-bit ASCII equivalents.
  102. | The array is used by the "ascii" method on the Str class to get strings
  103. | ready for inclusion in a URL slug.
  104. |
  105. | Of course, the "ascii" method may also be used by you for whatever your
  106. | application requires. Feel free to add any characters we missed, and be
  107. | sure to let us know about them!
  108. |
  109. */
  110. 'ascii' => array(
  111. '/æ|ǽ/' => 'ae',
  112. '/œ/' => 'oe',
  113. '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|А/' => 'A',
  114. '/à|á|â|ã|ä|å|ǻ|ā|ă|ą|ǎ|ª|а/' => 'a',
  115. '/Б/' => 'B',
  116. '/б/' => 'b',
  117. '/Ç|Ć|Ĉ|Ċ|Č|Ц/' => 'C',
  118. '/ç|ć|ĉ|ċ|č|ц/' => 'c',
  119. '/Ð|Ď|Đ|Д/' => 'Dj',
  120. '/ð|ď|đ|д/' => 'dj',
  121. '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Е|Ё|Э/' => 'E',
  122. '/è|é|ê|ë|ē|ĕ|ė|ę|ě|е|ё|э/' => 'e',
  123. '/Ф/' => 'F',
  124. '/ƒ|ф/' => 'f',
  125. '/Ĝ|Ğ|Ġ|Ģ|Г/' => 'G',
  126. '/ĝ|ğ|ġ|ģ|г/' => 'g',
  127. '/Ĥ|Ħ|Х/' => 'H',
  128. '/ĥ|ħ|х/' => 'h',
  129. '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|И/' => 'I',
  130. '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|и/' => 'i',
  131. '/Ĵ|Й/' => 'J',
  132. '/ĵ|й/' => 'j',
  133. '/Ķ|К/' => 'K',
  134. '/ķ|к/' => 'k',
  135. '/Ĺ|Ļ|Ľ|Ŀ|Ł|Л/' => 'L',
  136. '/ĺ|ļ|ľ|ŀ|ł|л/' => 'l',
  137. '/М/' => 'M',
  138. '/м/' => 'm',
  139. '/Ñ|Ń|Ņ|Ň|Н/' => 'N',
  140. '/ñ|ń|ņ|ň|ʼn|н/' => 'n',
  141. '/Ö|Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|О/' => 'O',
  142. '/ö|ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|о/' => 'o',
  143. '/П/' => 'P',
  144. '/п/' => 'p',
  145. '/Ŕ|Ŗ|Ř|Р/' => 'R',
  146. '/ŕ|ŗ|ř|р/' => 'r',
  147. '/Ś|Ŝ|Ş|Ș|Š|С/' => 'S',
  148. '/ś|ŝ|ş|ș|š|ſ|с/' => 's',
  149. '/Ţ|Ț|Ť|Ŧ|Т/' => 'T',
  150. '/ţ|ț|ť|ŧ|т/' => 't',
  151. '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ü|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|У/' => 'U',
  152. '/ù|ú|û|ũ|ū|ŭ|ů|ü|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|у/' => 'u',
  153. '/В/' => 'V',
  154. '/в/' => 'v',
  155. '/Ý|Ÿ|Ŷ|Ы/' => 'Y',
  156. '/ý|ÿ|ŷ|ы/' => 'y',
  157. '/Ŵ/' => 'W',
  158. '/ŵ/' => 'w',
  159. '/Ź|Ż|Ž|З/' => 'Z',
  160. '/ź|ż|ž|з/' => 'z',
  161. '/Æ|Ǽ/' => 'AE',
  162. '/ß/'=> 'ss',
  163. '/IJ/' => 'IJ',
  164. '/ij/' => 'ij',
  165. '/Œ/' => 'OE',
  166. '/Ч/' => 'Ch',
  167. '/ч/' => 'ch',
  168. '/Ю/' => 'Ju',
  169. '/ю/' => 'ju',
  170. '/Я/' => 'Ja',
  171. '/я/' => 'ja',
  172. '/Ш/' => 'Sh',
  173. '/ш/' => 'sh',
  174. '/Щ/' => 'Shch',
  175. '/щ/' => 'shch',
  176. '/Ж/' => 'Zh',
  177. '/ж/' => 'zh',
  178. ),
  179. );