;; style file for xindy
;; filename: LatinRules.xdy
;;
;; It is based upon xindy's files lang/general/utf8.xdy and
;; lang/general/utf8-lang.xdy which implement
;; "a general sorting order for Western European languages"
;;
;; The aim for Sphinx is to be able to index in a Cyrillic document
;; also terms using the Latin alphabets, inclusive of letters
;; with diacritics.  To this effect the xindy rules from lang/general
;; got manually re-coded to avoid collisions with the encoding
;; done by xindy for sorting words in Cyrillic languages, which was
;; observed not to use bytes with octal encoding 0o266 or higher.
;;
;; So here we use only 0o266 or higher bytes.
;; (Ŋ, ŋ, IJ, and ij are absent from
;; lang/general/utf8.xdy and not included here)
;; Contributed by the Sphinx team, 2018.

(define-letter-group "A" :prefixes ("¶"))
(define-letter-group "B" :after "A" :prefixes ("·"))
(define-letter-group "C" :after "B" :prefixes ("¸"))
(define-letter-group "D" :after "C" :prefixes ("¹"))
(define-letter-group "E" :after "D" :prefixes ("º"))
(define-letter-group "F" :after "E" :prefixes ("»"))
(define-letter-group "G" :after "F" :prefixes ("¼"))
(define-letter-group "H" :after "G" :prefixes ("½"))
(define-letter-group "I" :after "H" :prefixes ("¾"))
(define-letter-group "J" :after "I" :prefixes ("¿"))
(define-letter-group "K" :after "J" :prefixes ("À"))
(define-letter-group "L" :after "K" :prefixes ("Á"))
(define-letter-group "M" :after "L" :prefixes ("Â"))
(define-letter-group "N" :after "M" :prefixes ("Ã"))
(define-letter-group "O" :after "N" :prefixes ("Ä"))
(define-letter-group "P" :after "O" :prefixes ("È"))
(define-letter-group "Q" :after "P" :prefixes ("Ê"))
(define-letter-group "R" :after "Q" :prefixes ("Ë"))
(define-letter-group "S" :after "R" :prefixes ("Ð"))
(define-letter-group "T" :after "S" :prefixes ("Ú"))
(define-letter-group "U" :after "T" :prefixes ("à"))
(define-letter-group "V" :after "U" :prefixes ("å"))
(define-letter-group "W" :after "V" :prefixes ("æ"))
(define-letter-group "X" :after "W" :prefixes ("ë"))
(define-letter-group "Y" :after "X" :prefixes ("í"))
(define-letter-group "Z" :after "Y" :prefixes ("ð"))

(define-rule-set "sphinx-xy-alphabetize"

  :rules  (("À" "¶" :string)
           ("Ä‚" "¶" :string)
           ("â" "¶" :string)
           ("Ä" "¶" :string)
           ("à" "¶" :string)
           ("Ã…" "¶" :string)
           ("Ã" "¶" :string)
           ("Á" "¶" :string)
           ("á" "¶" :string)
           ("ã" "¶" :string)
           ("Â" "¶" :string)
           ("ă" "¶" :string)
           ("Ã¥" "¶" :string)
           ("Ä…" "¶" :string)
           ("ä" "¶" :string)
           ("Ä„" "¶" :string)
           ("æ" "¶º" :string)
           ("Æ" "¶º" :string)
           ("ć" "¸" :string)
           ("ĉ" "¸" :string)
           ("ç" "¸" :string)
           ("ÄŒ" "¸" :string)
           ("č" "¸" :string)
           ("Ĉ" "¸" :string)
           ("Ç" "¸" :string)
           ("Ć" "¸" :string)
           ("ď" "¹" :string)
           ("Đ" "¹" :string)
           ("ÄŽ" "¹" :string)
           ("Ä‘" "¹" :string)
           ("ê" "º" :string)
           ("Ę" "º" :string)
           ("Äš" "º" :string)
           ("ë" "º" :string)
           ("Ä›" "º" :string)
           ("é" "º" :string)
           ("È" "º" :string)
           ("Ë" "º" :string)
           ("É" "º" :string)
           ("è" "º" :string)
           ("Ê" "º" :string)
           ("Ä™" "º" :string)
           ("ĝ" "¼" :string)
           ("ÄŸ" "¼" :string)
           ("Äž" "¼" :string)
           ("Äœ" "¼" :string)
           ("Ä¥" "½" :string)
           ("Ĥ" "½" :string)
           ("Ï" "¾" :string)
           ("Í" "¾" :string)
           ("ï" "¾" :string)
           ("ÃŽ" "¾" :string)
           ("î" "¾" :string)
           ("ı" "¾" :string)
           ("Ä°" "¾" :string)
           ("í" "¾" :string)
           ("ÃŒ" "¾" :string)
           ("ì" "¾" :string)
           ("Ä´" "¿" :string)
           ("ĵ" "¿" :string)
           ("Å‚" "Á" :string)
           ("Ł" "Á" :string)
           ("ľ" "Á" :string)
           ("Ľ" "Á" :string)
           ("Å„" "Ã" :string)
           ("Ń" "Ã" :string)
           ("ñ" "Ã" :string)
           ("ň" "Ã" :string)
           ("Ñ" "Ã" :string)
           ("Ň" "Ã" :string)
           ("Õ" "Ä" :string)
           ("Ő" "Ä" :string)
           ("ó" "Ä" :string)
           ("ö" "Ä" :string)
           ("ô" "Ä" :string)
           ("Å‘" "Ä" :string)
           ("Ø" "Ä" :string)
           ("Ö" "Ä" :string)
           ("õ" "Ä" :string)
           ("Ô" "Ä" :string)
           ("ø" "Ä" :string)
           ("Ó" "Ä" :string)
           ("Ã’" "Ä" :string)
           ("ò" "Ä" :string)
           ("œ" "ĺ" :string)
           ("Œ" "ĺ" :string)
           ("Ř" "Ë" :string)
           ("Å™" "Ë" :string)
           ("Å”" "Ë" :string)
           ("Å•" "Ë" :string)
           ("ŝ" "Ð" :string)
           ("Åš" "Ð" :string)
           ("È™" "Ð" :string)
           ("ÅŸ" "Ð" :string)
           ("Åœ" "Ð" :string)
           ("Å›" "Ð" :string)
           ("Ș" "Ð" :string)
           ("Å¡" "Ð" :string)
           ("Åž" "Ð" :string)
           ("Å " "Ð" :string)
           ("ß" "ÐÐ" :string)
           ("Èš" "Ú" :string)
           ("Ť" "Ú" :string)
           ("È›" "Ú" :string)
           ("Å¥" "Ú" :string)
           ("û" "à" :string)
           ("Å­" "à" :string)
           ("ů" "à" :string)
           ("ű" "à" :string)
           ("ù" "à" :string)
           ("Ŭ" "à" :string)
           ("Ù" "à" :string)
           ("Å°" "à" :string)
           ("Ãœ" "à" :string)
           ("Å®" "à" :string)
           ("ú" "à" :string)
           ("Ú" "à" :string)
           ("Û" "à" :string)
           ("ü" "à" :string)
           ("ÿ" "í" :string)
           ("Ý" "í" :string)
           ("Ÿ" "í" :string)
           ("ý" "í" :string)
           ("Å»" "ð" :string)
           ("Ž" "ð" :string)
           ("Ź" "ð" :string)
           ("ž" "ð" :string)
           ("ż" "ð" :string)
           ("ź" "ð" :string)
           ("a" "¶" :string)
           ("A" "¶" :string)
           ("b" "·" :string)
           ("B" "·" :string)
           ("c" "¸" :string)
           ("C" "¸" :string)
           ("d" "¹" :string)
           ("D" "¹" :string)
           ("e" "º" :string)
           ("E" "º" :string)
           ("F" "»" :string)
           ("f" "»" :string)
           ("G" "¼" :string)
           ("g" "¼" :string)
           ("H" "½" :string)
           ("h" "½" :string)
           ("i" "¾" :string)
           ("I" "¾" :string)
           ("J" "¿" :string)
           ("j" "¿" :string)
           ("K" "À" :string)
           ("k" "À" :string)
           ("L" "Á" :string)
           ("l" "Á" :string)
           ("M" "Â" :string)
           ("m" "Â" :string)
           ("n" "Ã" :string)
           ("N" "Ã" :string)
           ("O" "Ä" :string)
           ("o" "Ä" :string)
           ("p" "È" :string)
           ("P" "È" :string)
           ("Q" "Ê" :string)
           ("q" "Ê" :string)
           ("r" "Ë" :string)
           ("R" "Ë" :string)
           ("S" "Ð" :string)
           ("s" "Ð" :string)
           ("t" "Ú" :string)
           ("T" "Ú" :string)
           ("u" "à" :string)
           ("U" "à" :string)
           ("v" "å" :string)
           ("V" "å" :string)
           ("W" "æ" :string)
           ("w" "æ" :string)
           ("x" "ë" :string)
           ("X" "ë" :string)
           ("Y" "í" :string)
           ("y" "í" :string)
           ("z" "ð" :string)
           ("Z" "ð" :string)
           ))

(define-rule-set "sphinx-xy-resolve-diacritics"

  :rules  (("Ĥ" "£" :string)
           ("ó" "£" :string)
           ("ľ" "£" :string)
           ("Ř" "£" :string)
           ("ĝ" "£" :string)
           ("ď" "£" :string)
           ("Äš" "£" :string)
           ("Ä¥" "£" :string)
           ("ÄŒ" "£" :string)
           ("Ä´" "£" :string)
           ("Ä›" "£" :string)
           ("ž" "£" :string)
           ("ÄŽ" "£" :string)
           ("Å™" "£" :string)
           ("Ž" "£" :string)
           ("ı" "£" :string)
           ("Ť" "£" :string)
           ("á" "£" :string)
           ("č" "£" :string)
           ("Á" "£" :string)
           ("ň" "£" :string)
           ("Å " "£" :string)
           ("Ň" "£" :string)
           ("ĵ" "£" :string)
           ("Å¥" "£" :string)
           ("Ó" "£" :string)
           ("ý" "£" :string)
           ("Äœ" "£" :string)
           ("Ú" "£" :string)
           ("Ľ" "£" :string)
           ("Å¡" "£" :string)
           ("Ý" "£" :string)
           ("ú" "£" :string)
           ("Åš" "¤" :string)
           ("ć" "¤" :string)
           ("Ł" "¤" :string)
           ("Å‚" "¤" :string)
           ("Å„" "¤" :string)
           ("À" "¤" :string)
           ("Ź" "¤" :string)
           ("à" "¤" :string)
           ("Ń" "¤" :string)
           ("Đ" "¤" :string)
           ("ÿ" "¤" :string)
           ("Å›" "¤" :string)
           ("Äž" "¤" :string)
           ("ÄŸ" "¤" :string)
           ("Ù" "¤" :string)
           ("Ä°" "¤" :string)
           ("Ä‘" "¤" :string)
           ("ù" "¤" :string)
           ("Èš" "¤" :string)
           ("é" "¤" :string)
           ("Å•" "¤" :string)
           ("Ć" "¤" :string)
           ("È›" "¤" :string)
           ("ò" "¤" :string)
           ("ź" "¤" :string)
           ("Ã’" "¤" :string)
           ("Ÿ" "¤" :string)
           ("Å”" "¤" :string)
           ("É" "¤" :string)
           ("ĉ" "¥" :string)
           ("ô" "¥" :string)
           ("Í" "¥" :string)
           ("ŝ" "¥" :string)
           ("Å»" "¥" :string)
           ("Ä‚" "¥" :string)
           ("Åœ" "¥" :string)
           ("ñ" "¥" :string)
           ("Å­" "¥" :string)
           ("í" "¥" :string)
           ("È" "¥" :string)
           ("Ô" "¥" :string)
           ("Ŭ" "¥" :string)
           ("ż" "¥" :string)
           ("Ñ" "¥" :string)
           ("è" "¥" :string)
           ("Ĉ" "¥" :string)
           ("ă" "¥" :string)
           ("â" "¦" :string)
           ("û" "¦" :string)
           ("ê" "¦" :string)
           ("Õ" "¦" :string)
           ("õ" "¦" :string)
           ("È™" "¦" :string)
           ("ç" "¦" :string)
           ("Â" "¦" :string)
           ("Ê" "¦" :string)
           ("Û" "¦" :string)
           ("Ç" "¦" :string)
           ("ì" "¦" :string)
           ("ÃŒ" "¦" :string)
           ("Ș" "¦" :string)
           ("ö" "§" :string)
           ("Ö" "§" :string)
           ("ÅŸ" "§" :string)
           ("ů" "§" :string)
           ("ë" "§" :string)
           ("ã" "§" :string)
           ("î" "§" :string)
           ("ÃŽ" "§" :string)
           ("Ã" "§" :string)
           ("Åž" "§" :string)
           ("Å®" "§" :string)
           ("Ë" "§" :string)
           ("ï" "¨" :string)
           ("Ő" "¨" :string)
           ("Ï" "¨" :string)
           ("Ę" "¨" :string)
           ("Å‘" "¨" :string)
           ("Ãœ" "¨" :string)
           ("Ã…" "¨" :string)
           ("ü" "¨" :string)
           ("Ä™" "¨" :string)
           ("Ã¥" "¨" :string)
           ("Ä" "©" :string)
           ("ű" "©" :string)
           ("Ø" "©" :string)
           ("ø" "©" :string)
           ("Å°" "©" :string)
           ("ä" "©" :string)
           ("Ä„" "ª" :string)
           ("Ä…" "ª" :string)
           ("Å“" "ÿ" :string)
           ("ß" "ÿ" :string)
           ("Æ" "ÿ" :string)
           ("Å’" "ÿ" :string)
           ("æ" "ÿ" :string)
           ("e" "¢" :string)
           ("t" "¢" :string)
           ("L" "¢" :string)
           ("Y" "¢" :string)
           ("J" "¢" :string)
           ("a" "¢" :string)
           ("p" "¢" :string)
           ("u" "¢" :string)
           ("j" "¢" :string)
           ("b" "¢" :string)
           ("G" "¢" :string)
           ("U" "¢" :string)
           ("F" "¢" :string)
           ("H" "¢" :string)
           ("i" "¢" :string)
           ("z" "¢" :string)
           ("c" "¢" :string)
           ("l" "¢" :string)
           ("A" "¢" :string)
           ("Q" "¢" :string)
           ("w" "¢" :string)
           ("D" "¢" :string)
           ("R" "¢" :string)
           ("d" "¢" :string)
           ("s" "¢" :string)
           ("r" "¢" :string)
           ("k" "¢" :string)
           ("v" "¢" :string)
           ("m" "¢" :string)
           ("P" "¢" :string)
           ("y" "¢" :string)
           ("K" "¢" :string)
           ("q" "¢" :string)
           ("S" "¢" :string)
           ("I" "¢" :string)
           ("C" "¢" :string)
           ("M" "¢" :string)
           ("Z" "¢" :string)
           ("T" "¢" :string)
           ("W" "¢" :string)
           ("B" "¢" :string)
           ("h" "¢" :string)
           ("x" "¢" :string)
           ("X" "¢" :string)
           ("f" "¢" :string)
           ("E" "¢" :string)
           ("V" "¢" :string)
           ("N" "¢" :string)
           ("O" "¢" :string)
           ("o" "¢" :string)
           ("g" "¢" :string)
           ("n" "¢" :string)
           ))

(define-rule-set "sphinx-xy-resolve-case"

  :rules  (("Ú" "8" :string)
           ("Ÿ" "8" :string)
           ("Ç" "8" :string)
           ("Ĉ" "8" :string)
           ("Å”" "8" :string)
           ("Ľ" "8" :string)
           ("Å®" "8" :string)
           ("Ý" "8" :string)
           ("É" "8" :string)
           ("Ë" "8" :string)
           ("Ș" "8" :string)
           ("Ì" "8" :string)
           ("Ê" "8" :string)
           ("Ň" "8" :string)
           ("Ä„" "8" :string)
           ("Å " "8" :string)
           ("Û" "8" :string)
           ("Åž" "8" :string)
           ("Ć" "8" :string)
           ("Ã’" "8" :string)
           ("Ĝ" "8" :string)
           ("Ñ" "8" :string)
           ("Ó" "8" :string)
           ("ÃŽ" "8" :string)
           ("Á" "8" :string)
           ("Ã" "8" :string)
           ("Èš" "8" :string)
           ("Ã…" "8" :string)
           ("Äž" "8" :string)
           ("Ü" "8" :string)
           ("È" "8" :string)
           ("Ô" "8" :string)
           ("Ä°" "8" :string)
           ("Å°" "8" :string)
           ("Ù" "8" :string)
           ("Ŭ" "8" :string)
           ("Â" "8" :string)
           ("Ť" "8" :string)
           ("Ń" "8" :string)
           ("ÄŽ" "8" :string)
           ("Ź" "8" :string)
           ("Ž" "8" :string)
           ("Đ" "8" :string)
           ("Ŝ" "8" :string)
           ("Č" "8" :string)
           ("Ä´" "8" :string)
           ("Ö" "8" :string)
           ("Ø" "8" :string)
           ("Å»" "8" :string)
           ("Ł" "8" :string)
           ("Ä‚" "8" :string)
           ("Äš" "8" :string)
           ("Ő" "8" :string)
           ("Õ" "8" :string)
           ("Ę" "8" :string)
           ("Ï" "8" :string)
           ("À" "8" :string)
           ("Ĥ" "8" :string)
           ("Ä" "8" :string)
           ("Åš" "8" :string)
           ("Ř" "8" :string)
           ("Í" "8" :string)
           ("Å’" "89" :string)
           ("Æ" "89" :string)
           ("ì" "9" :string)
           ("è" "9" :string)
           ("Ä…" "9" :string)
           ("Å¡" "9" :string)
           ("ú" "9" :string)
           ("Ã¥" "9" :string)
           ("ă" "9" :string)
           ("Ä™" "9" :string)
           ("ü" "9" :string)
           ("ź" "9" :string)
           ("ò" "9" :string)
           ("Å¥" "9" :string)
           ("È›" "9" :string)
           ("ĵ" "9" :string)
           ("Å•" "9" :string)
           ("ż" "9" :string)
           ("ä" "9" :string)
           ("ý" "9" :string)
           ("ù" "9" :string)
           ("á" "9" :string)
           ("é" "9" :string)
           ("č" "9" :string)
           ("ň" "9" :string)
           ("Å›" "9" :string)
           ("ø" "9" :string)
           ("í" "9" :string)
           ("Ä‘" "9" :string)
           ("ı" "9" :string)
           ("ÄŸ" "9" :string)
           ("î" "9" :string)
           ("ã" "9" :string)
           ("à" "9" :string)
           ("Å™" "9" :string)
           ("Å‘" "9" :string)
           ("ů" "9" :string)
           ("È™" "9" :string)
           ("ÿ" "9" :string)
           ("ë" "9" :string)
           ("Å­" "9" :string)
           ("ç" "9" :string)
           ("ű" "9" :string)
           ("ñ" "9" :string)
           ("õ" "9" :string)
           ("Ä›" "9" :string)
           ("ÅŸ" "9" :string)
           ("ž" "9" :string)
           ("ĝ" "9" :string)
           ("ŝ" "9" :string)
           ("Å„" "9" :string)
           ("û" "9" :string)
           ("Å‚" "9" :string)
           ("ď" "9" :string)
           ("Ä¥" "9" :string)
           ("ê" "9" :string)
           ("ô" "9" :string)
           ("ĉ" "9" :string)
           ("â" "9" :string)
           ("ć" "9" :string)
           ("ï" "9" :string)
           ("ö" "9" :string)
           ("ľ" "9" :string)
           ("ó" "9" :string)
           ("æ" "99" :string)
           ("ß" "99" :string)
           ("Å“" "99" :string)
           ("N" "8" :string)
           ("V" "8" :string)
           ("O" "8" :string)
           ("X" "8" :string)
           ("E" "8" :string)
           ("P" "8" :string)
           ("K" "8" :string)
           ("T" "8" :string)
           ("Z" "8" :string)
           ("M" "8" :string)
           ("C" "8" :string)
           ("I" "8" :string)
           ("S" "8" :string)
           ("B" "8" :string)
           ("W" "8" :string)
           ("D" "8" :string)
           ("R" "8" :string)
           ("H" "8" :string)
           ("F" "8" :string)
           ("Q" "8" :string)
           ("A" "8" :string)
           ("G" "8" :string)
           ("U" "8" :string)
           ("J" "8" :string)
           ("Y" "8" :string)
           ("L" "8" :string)
           ("o" "9" :string)
           ("n" "9" :string)
           ("g" "9" :string)
           ("x" "9" :string)
           ("f" "9" :string)
           ("y" "9" :string)
           ("q" "9" :string)
           ("h" "9" :string)
           ("w" "9" :string)
           ("s" "9" :string)
           ("d" "9" :string)
           ("v" "9" :string)
           ("k" "9" :string)
           ("r" "9" :string)
           ("m" "9" :string)
           ("z" "9" :string)
           ("c" "9" :string)
           ("i" "9" :string)
           ("l" "9" :string)
           ("b" "9" :string)
           ("j" "9" :string)
           ("a" "9" :string)
           ("p" "9" :string)
           ("u" "9" :string)
           ("t" "9" :string)
           ("e" "9" :string)
           ))

(use-rule-set :run 0
	      :rule-set ("sphinx-xy-alphabetize"))
(use-rule-set :run 1
	      :rule-set ("sphinx-xy-resolve-diacritics"))
(use-rule-set :run 2
	      :rule-set ("sphinx-xy-resolve-case"))