package Ġcom . bk ahl ert . kom mon s . text Ċ Ċ import Ġcom . bk ahl ert . kom mon s . collections . Dictionary Ċ import Ġcom . bk ahl ert . kom mon s . collections . dict Of Ċ import Ġcom . bk ahl ert . kom mon s . math . Round ingMode Ċ import Ġcom . bk ahl ert . kom mon s . math . Round ingMode . CE IL ING Ċ import Ġcom . bk ahl ert . kom mon s . runtime . as System Resource Url Ċ import Ġcom . bk ahl ert . kom mon s . text . Line Separ ators . LF Ċ import Ġcom . bk ahl ert . kom mon s . text . Unicode . E moj is . Emoji Ċ import Ġcom . bk ahl ert . kom mon s . text . Unicode . E moj is . Full Hours Dictionary Ċ import Ġcom . bk ahl ert . kom mon s . text . Unicode . E moj is . Half Hours Dictionary Ċ import Ġcom . bk ahl ert . kom mon s . text . Unicode . Unicode Block Meta Ċ import Ġjava . net . URL Ċ import Ġjava . time . Instant Ċ import Ġjava . time . Zone Offset Ċ import Ġjava . time . Z onedDateTime Ċ import Ġkotlin . streams . toList Ċ Ċ private Ġobject ĠUnicode Dict Ġ: ĠDictionary < Long , ĠString > Ġby Ċ dict Of (" unicode . dict . tsv ". as System Resource Url (). load Tab Separ ated Values ( skip Lines Ġ= Ġ 1 ), Ġ{ Ġ"\\ u ${ it . toString ( 1 6 )} !! ${ it . toInt (). to Char (). category . name }" Ġ}) Ċ Ċ public Ġoperator Ġfun ĠUnicode . get ( code Point : ĠLong ): ĠString Ġ= ĠUnicode Dict . get ( code Point ) Ċ Ċ public Ġfun ĠInstant . as Emoji ( rounding Mode : ĠRound ingMode Ġ= ĠCE IL ING ): ĠEmoji Ġ{ ĊĠĠĠ Ġval Ġz onedDateTime : ĠZ onedDateTime Ġ= Ġat Zone ( Zone Offset . UTC ) ĊĠĠĠ Ġval Ġhour Ġ= Ġz onedDateTime . hour ĊĠĠĠ Ġval Ġminute Ġ= Ġz onedDateTime . minute ĊĠĠĠ Ġval Ġclosest Ġ= Ġ( rounding Mode ( minute . toDouble (), Ġ 3 0 . 0 ) Ġ/ Ġ 3 0 . 0 ). toInt () ĊĠĠĠ Ġreturn ĠlistOf ( Full Hours Dictionary [ hour ], ĠHalf Hours Dictionary [ hour ], ĠFull Hours Dictionary [ hour Ġ+ Ġ 1 ])[ closest ] Ċ } Ċ Ċ public Ġfun Ġ< T > ĠUnicode Block Meta < T >. as Table (): ĠString Ġwhere ĠT Ġ: ĠUnicode . Unicode Block < T >, ĠT Ġ: ĠEnum < T > Ġ= Ġwith ( unicode Block ) Ġ{ ĊĠĠĠ Ġcheck ( isValid ) Ġ{ Ġ" Unicode Ġblock Ġmust Ġhave Ġthe Ġsame Ġnumber Ġof Ġvalues Ġ($ value Count ) Ġas Ġcode Ġpoints Ġ($ code Point Count )." Ġ} ĊĠĠĠ Ġval Ġtable Ġ= ĠStringBuilder () ĊĠĠĠ Ġfor Ġ( code Point Ġin Ġrange ) Ġ{ ĊĠĠĠĠĠĠĠ Ġtable . append ("$ code Point \ t ${ code Point . unicode Name }$ LF ") ĊĠĠĠ Ġ} ĊĠĠĠ Ġ"$ table " Ċ } Ċ Ċ private Ġfun ĠURL . load Tab Separ ated Values ( skip Lines : ĠLong ) Ġ= Ġopen Stream (). buffered Reader (). lines (). skip ( skip Lines ). map Ġ{ Ġrow Ġ-> ĊĠĠĠ Ġrow . split ("\ t "). let Ġ{ Ġjava . lang . Long . parse Long ( it . first (), Ġ 1 6 ) Ġto Ġit . last () Ġ} Ċ }. toList (). toMap () Ċ