strings.php 4.8 KB

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