unicode

Branch: main

Switch branches or tags

Branch: main
Go to file t

413 files indexed

History
Code

ucd/joining_group.mbt
1///|2/// Joining_Group values and lookup3/// Generated from DerivedJoiningGroup.txt45///|6/// Unicode Joining_Group values7/// See the Unicode Standard, section 9.2, Arabic:8/// https://www.unicode.org/versions/latest/core-spec/chapter-9/#G74809#derive(Debug, Eq)10pub(all) enum JoiningGroup {11  AfricanFeh // African_Feh12  AfricanNoon // African_Noon13  AfricanQaf // African_Qaf14  Ain // Ain15  Alaph // Alaph16  Alef // Alef17  Beh // Beh18  Beth // Beth19  BurushaskiYehBarree // Burushaski_Yeh_Barree20  CrownAin // Crown_Ain21  CrownBeh // Crown_Beh22  CrownFeh // Crown_Feh23  CrownHah // Crown_Hah24  CrownHeh // Crown_Heh25  CrownKaf // Crown_Kaf26  CrownMeem // Crown_Meem27  CrownSad // Crown_Sad28  CrownSeen // Crown_Seen29  CrownTah // Crown_Tah30  Dal // Dal31  DalathRish // Dalath_Rish32  E // E33  FarsiYeh // Farsi_Yeh34  Fe // Fe35  Feh // Feh36  FinalSemkath // Final_Semkath37  Gaf // Gaf38  Gamal // Gamal39  Hah // Hah40  HanifiRohingyaKinnaYa // Hanifi_Rohingya_Kinna_Ya41  HanifiRohingyaPa // Hanifi_Rohingya_Pa42  He // He43  Heh // Heh44  HehGoal // Heh_Goal45  Heth // Heth46  Kaf // Kaf47  Kaph // Kaph48  KashmiriYeh // Kashmiri_Yeh49  Khaph // Khaph50  KnottedHeh // Knotted_Heh51  Lam // Lam52  Lamadh // Lamadh53  MalayalamBha // Malayalam_Bha54  MalayalamJa // Malayalam_Ja55  MalayalamLla // Malayalam_Lla56  MalayalamLlla // Malayalam_Llla57  MalayalamNga // Malayalam_Nga58  MalayalamNna // Malayalam_Nna59  MalayalamNnna // Malayalam_Nnna60  MalayalamNya // Malayalam_Nya61  MalayalamRa // Malayalam_Ra62  MalayalamSsa // Malayalam_Ssa63  MalayalamTta // Malayalam_Tta64  ManichaeanAleph // Manichaean_Aleph65  ManichaeanAyin // Manichaean_Ayin66  ManichaeanBeth // Manichaean_Beth67  ManichaeanDaleth // Manichaean_Daleth68  ManichaeanDhamedh // Manichaean_Dhamedh69  ManichaeanFive // Manichaean_Five70  ManichaeanGimel // Manichaean_Gimel71  ManichaeanHeth // Manichaean_Heth72  ManichaeanHundred // Manichaean_Hundred73  ManichaeanKaph // Manichaean_Kaph74  ManichaeanLamedh // Manichaean_Lamedh75  ManichaeanMem // Manichaean_Mem76  ManichaeanNun // Manichaean_Nun77  ManichaeanOne // Manichaean_One78  ManichaeanPe // Manichaean_Pe79  ManichaeanQoph // Manichaean_Qoph80  ManichaeanResh // Manichaean_Resh81  ManichaeanSadhe // Manichaean_Sadhe82  ManichaeanSamekh // Manichaean_Samekh83  ManichaeanTaw // Manichaean_Taw84  ManichaeanTen // Manichaean_Ten85  ManichaeanTeth // Manichaean_Teth86  ManichaeanThamedh // Manichaean_Thamedh87  ManichaeanTwenty // Manichaean_Twenty88  ManichaeanWaw // Manichaean_Waw89  ManichaeanYodh // Manichaean_Yodh90  ManichaeanZayin // Manichaean_Zayin91  Meem // Meem92  Mim // Mim93  NoJoiningGroup // No_Joining_Group94  Noon // Noon95  Nun // Nun96  Nya // Nya97  Pe // Pe98  Qaf // Qaf99  Qaph // Qaph100  Reh // Reh101  ReversedPe // Reversed_Pe102  RohingyaYeh // Rohingya_Yeh103  Sad // Sad104  Sadhe // Sadhe105  Seen // Seen106  Semkath // Semkath107  Shin // Shin108  StraightWaw // Straight_Waw109  SwashKaf // Swash_Kaf110  SyriacWaw // Syriac_Waw111  Tah // Tah112  Taw // Taw113  TehMarbuta // Teh_Marbuta114  TehMarbutaGoal // Teh_Marbuta_Goal115  Teth // Teth116  ThinNoon // Thin_Noon117  ThinYeh // Thin_Yeh118  VerticalTail // Vertical_Tail119  Waw // Waw120  Yeh // Yeh121  YehBarree // Yeh_Barree122  YehWithTail // Yeh_With_Tail123  Yudh // Yudh124  YudhHe // Yudh_He125  Zain // Zain126  Zhain // Zhain127}128129///|130#deprecated("Use `Debug::to_repr` instead", skip_current_package=true)131#doc(hidden)132pub extend JoiningGroup with Debug::{to_repr}133134///|135pub extend JoiningGroup with Eq::{not_equal, equal}136137///|138pub extend JoiningGroup with Show::{to_string, output}139140///|141pub impl Show for JoiningGroup with fn output(self, logger) {142  logger.write_string(143    match self {144      AfricanFeh => "AfricanFeh"145      AfricanNoon => "AfricanNoon"146      AfricanQaf => "AfricanQaf"147      Ain => "Ain"148      Alaph => "Alaph"149      Alef => "Alef"150      Beh => "Beh"151      Beth => "Beth"152      BurushaskiYehBarree => "BurushaskiYehBarree"153      CrownAin => "CrownAin"154      CrownBeh => "CrownBeh"155      CrownFeh => "CrownFeh"156      CrownHah => "CrownHah"157      CrownHeh => "CrownHeh"158      CrownKaf => "CrownKaf"159      CrownMeem => "CrownMeem"160      CrownSad => "CrownSad"161      CrownSeen => "CrownSeen"162      CrownTah => "CrownTah"163      Dal => "Dal"164      DalathRish => "DalathRish"165      E => "E"166      FarsiYeh => "FarsiYeh"167      Fe => "Fe"168      Feh => "Feh"169      FinalSemkath => "FinalSemkath"170      Gaf => "Gaf"171      Gamal => "Gamal"172      Hah => "Hah"173      HanifiRohingyaKinnaYa => "HanifiRohingyaKinnaYa"174      HanifiRohingyaPa => "HanifiRohingyaPa"175      He => "He"176      Heh => "Heh"177      HehGoal => "HehGoal"178      Heth => "Heth"179      Kaf => "Kaf"180      Kaph => "Kaph"181      KashmiriYeh => "KashmiriYeh"182      Khaph => "Khaph"183      KnottedHeh => "KnottedHeh"184      Lam => "Lam"185      Lamadh => "Lamadh"186      MalayalamBha => "MalayalamBha"187      MalayalamJa => "MalayalamJa"188      MalayalamLla => "MalayalamLla"189      MalayalamLlla => "MalayalamLlla"190      MalayalamNga => "MalayalamNga"191      MalayalamNna => "MalayalamNna"192      MalayalamNnna => "MalayalamNnna"193      MalayalamNya => "MalayalamNya"194      MalayalamRa => "MalayalamRa"195      MalayalamSsa => "MalayalamSsa"196      MalayalamTta => "MalayalamTta"197      ManichaeanAleph => "ManichaeanAleph"198      ManichaeanAyin => "ManichaeanAyin"199      ManichaeanBeth => "ManichaeanBeth"200      ManichaeanDaleth => "ManichaeanDaleth"201      ManichaeanDhamedh => "ManichaeanDhamedh"202      ManichaeanFive => "ManichaeanFive"203      ManichaeanGimel => "ManichaeanGimel"204      ManichaeanHeth => "ManichaeanHeth"205      ManichaeanHundred => "ManichaeanHundred"206      ManichaeanKaph => "ManichaeanKaph"207      ManichaeanLamedh => "ManichaeanLamedh"208      ManichaeanMem => "ManichaeanMem"209      ManichaeanNun => "ManichaeanNun"210      ManichaeanOne => "ManichaeanOne"211      ManichaeanPe => "ManichaeanPe"212      ManichaeanQoph => "ManichaeanQoph"213      ManichaeanResh => "ManichaeanResh"214      ManichaeanSadhe => "ManichaeanSadhe"215      ManichaeanSamekh => "ManichaeanSamekh"216      ManichaeanTaw => "ManichaeanTaw"217      ManichaeanTen => "ManichaeanTen"218      ManichaeanTeth => "ManichaeanTeth"219      ManichaeanThamedh => "ManichaeanThamedh"220      ManichaeanTwenty => "ManichaeanTwenty"221      ManichaeanWaw => "ManichaeanWaw"222      ManichaeanYodh => "ManichaeanYodh"223      ManichaeanZayin => "ManichaeanZayin"224      Meem => "Meem"225      Mim => "Mim"226      NoJoiningGroup => "NoJoiningGroup"227      Noon => "Noon"228      Nun => "Nun"229      Nya => "Nya"230      Pe => "Pe"231      Qaf => "Qaf"232      Qaph => "Qaph"233      Reh => "Reh"234      ReversedPe => "ReversedPe"235      RohingyaYeh => "RohingyaYeh"236      Sad => "Sad"237      Sadhe => "Sadhe"238      Seen => "Seen"239      Semkath => "Semkath"240      Shin => "Shin"241      StraightWaw => "StraightWaw"242      SwashKaf => "SwashKaf"243      SyriacWaw => "SyriacWaw"244      Tah => "Tah"245      Taw => "Taw"246      TehMarbuta => "TehMarbuta"247      TehMarbutaGoal => "TehMarbutaGoal"248      Teth => "Teth"249      ThinNoon => "ThinNoon"250      ThinYeh => "ThinYeh"251      VerticalTail => "VerticalTail"252      Waw => "Waw"253      Yeh => "Yeh"254      YehBarree => "YehBarree"255      YehWithTail => "YehWithTail"256      Yudh => "Yudh"257      YudhHe => "YudhHe"258      Zain => "Zain"259      Zhain => "Zhain"260    },261  )262}263264///|265/// Convert a JoiningGroup ordinal, below 116, to the enum value.266///267/// A constructor without arguments is its ordinal on every backend. A268/// `match` or a table would cost a jump table or a load on wasm, wasm-gc269/// and JS, slower there than the trie lookup itself.270fn ordinal_to_joining_group(ordinal : Int32) -> JoiningGroup = "%identity"271272///|273/// Get the Joining_Group for a character.274///275/// Joining_Group classifies the letters of cursive scripts such as Arabic,276/// Syriac, and Manichaean by the shape they join with: letters that277/// differ only in their dots, like U+0628 ARABIC LETTER BEH and U+062A278/// ARABIC LETTER TEH, share a group. Characters that are not such279/// letters, including unassigned code points, are NoJoiningGroup.280///281/// The value `Pe` shares its name with a `GeneralCategory` value: write282/// `JoiningGroup::Pe` or `GeneralCategory::Pe` where the type is not283/// known from the context.284pub fn joining_group(c : Char) -> JoiningGroup {285  ordinal_to_joining_group(@joining_group.lookup_joining_group(c))286}287