strings.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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 on 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. ),
  94. /*
  95. |--------------------------------------------------------------------------
  96. | ASCII Characters
  97. |--------------------------------------------------------------------------
  98. |
  99. | This array contains foreign characters and their 7-bit ASCII equivalents.
  100. | The array is used by the "ascii" method on the Str class to get strings
  101. | ready for inclusion in a URL slug.
  102. |
  103. | Of course, the "ascii" method may also be used by you for whatever your
  104. | application requires. Feel free to add any characters we missed, and be
  105. | sure to let us know about them!
  106. |
  107. */
  108. 'ascii' => array(
  109. '/æ|ǽ/' => 'ae',
  110. '/œ/' => 'oe',
  111. '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|А/' => 'A',
  112. '/à|á|â|ã|ä|å|ǻ|ā|ă|ą|ǎ|ª|а/' => 'a',
  113. '/Б/' => 'B',
  114. '/б/' => 'b',
  115. '/Ç|Ć|Ĉ|Ċ|Č|Ц/' => 'C',
  116. '/ç|ć|ĉ|ċ|č|ц/' => 'c',
  117. '/Ð|Ď|Đ|Д/' => 'Dj',
  118. '/ð|ď|đ|д/' => 'dj',
  119. '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Е|Ё|Э/' => 'E',
  120. '/è|é|ê|ë|ē|ĕ|ė|ę|ě|е|ё|э/' => 'e',
  121. '/Ф/' => 'F',
  122. '/ƒ|ф/' => 'f',
  123. '/Ĝ|Ğ|Ġ|Ģ|Г/' => 'G',
  124. '/ĝ|ğ|ġ|ģ|г/' => 'g',
  125. '/Ĥ|Ħ|Х/' => 'H',
  126. '/ĥ|ħ|х/' => 'h',
  127. '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|И/' => 'I',
  128. '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|и/' => 'i',
  129. '/Ĵ|Й/' => 'J',
  130. '/ĵ|й/' => 'j',
  131. '/Ķ|К/' => 'K',
  132. '/ķ|к/' => 'k',
  133. '/Ĺ|Ļ|Ľ|Ŀ|Ł|Л/' => 'L',
  134. '/ĺ|ļ|ľ|ŀ|ł|л/' => 'l',
  135. '/М/' => 'M',
  136. '/м/' => 'm',
  137. '/Ñ|Ń|Ņ|Ň|Н/' => 'N',
  138. '/ñ|ń|ņ|ň|ʼn|н/' => 'n',
  139. '/Ö|Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|О/' => 'O',
  140. '/ö|ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|о/' => 'o',
  141. '/П/' => 'P',
  142. '/п/' => 'p',
  143. '/Ŕ|Ŗ|Ř|Р/' => 'R',
  144. '/ŕ|ŗ|ř|р/' => 'r',
  145. '/Ś|Ŝ|Ş|Ș|Š|С/' => 'S',
  146. '/ś|ŝ|ş|ș|š|ſ|с/' => 's',
  147. '/Ţ|Ț|Ť|Ŧ|Т/' => 'T',
  148. '/ţ|ț|ť|ŧ|т/' => 't',
  149. '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ü|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|У/' => 'U',
  150. '/ù|ú|û|ũ|ū|ŭ|ů|ü|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|у/' => 'u',
  151. '/В/' => 'V',
  152. '/в/' => 'v',
  153. '/Ý|Ÿ|Ŷ|Ы/' => 'Y',
  154. '/ý|ÿ|ŷ|ы/' => 'y',
  155. '/Ŵ/' => 'W',
  156. '/ŵ/' => 'w',
  157. '/Ź|Ż|Ž|З/' => 'Z',
  158. '/ź|ż|ž|з/' => 'z',
  159. '/Æ|Ǽ/' => 'AE',
  160. '/ß/'=> 'ss',
  161. '/IJ/' => 'IJ',
  162. '/ij/' => 'ij',
  163. '/Œ/' => 'OE',
  164. '/Ч/' => 'Ch',
  165. '/ч/' => 'ch',
  166. '/Ю/' => 'Ju',
  167. '/ю/' => 'ju',
  168. '/Я/' => 'Ja',
  169. '/я/' => 'ja',
  170. '/Ш/' => 'Sh',
  171. '/ш/' => 'sh',
  172. '/Щ/' => 'Shch',
  173. '/щ/' => 'shch',
  174. '/Ж/' => 'Zh',
  175. '/ж/' => 'zh',
  176. ),
  177. );