unicode no longer depends on *.lib
							parent
							
								
									c11ecef623
								
							
						
					
					
						commit
						b2fa4e2f07
					
				| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
USING: unicode.categories kernel math combinators splitting
 | 
			
		||||
sequences math.parser io.files io assocs arrays namespaces
 | 
			
		||||
combinators.lib assocs.lib math.ranges unicode.normalize
 | 
			
		||||
math.ranges unicode.normalize
 | 
			
		||||
unicode.syntax unicode.data compiler.units alien.syntax io.encodings.ascii ;
 | 
			
		||||
IN: unicode.breaks
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -27,7 +27,7 @@ CATEGORY: grapheme-control Zl Zp Cc Cf ;
 | 
			
		|||
    [ "#" split1 drop ";" split1 drop trim-blank ] map
 | 
			
		||||
    [ empty? not ] subset
 | 
			
		||||
    [ ".." split1 [ dup ] unless* [ hex> ] bi@ [a,b] ] map
 | 
			
		||||
    concat >set ;
 | 
			
		||||
    concat [ dup ] H{ } map>assoc ;
 | 
			
		||||
 | 
			
		||||
: other-extend-lines ( -- lines )
 | 
			
		||||
    "extra/unicode/PropList.txt" resource-path ascii file-lines ;
 | 
			
		||||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ VALUE: other-extend
 | 
			
		|||
 | 
			
		||||
CATEGORY: (extend) Me Mn ;
 | 
			
		||||
: extend? ( ch -- ? )
 | 
			
		||||
    [ (extend)? ] [ other-extend key? ] either ;
 | 
			
		||||
    dup (extend)? [ ] [ other-extend key? ] ?if ;
 | 
			
		||||
 | 
			
		||||
: grapheme-class ( ch -- class )
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,8 +1,10 @@
 | 
			
		|||
USING: kernel unicode.data sequences sequences.next namespaces
 | 
			
		||||
assocs.lib unicode.normalize math unicode.categories combinators
 | 
			
		||||
unicode.normalize math unicode.categories combinators
 | 
			
		||||
assocs strings splitting ;
 | 
			
		||||
IN: unicode.case
 | 
			
		||||
 | 
			
		||||
: at-default ( key assoc -- value/key ) over >r at r> or ;
 | 
			
		||||
 | 
			
		||||
: ch>lower ( ch -- lower ) simple-lower at-default ;
 | 
			
		||||
: ch>upper ( ch -- upper ) simple-upper at-default ;
 | 
			
		||||
: ch>title ( ch -- title ) simple-title at-default ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
USING: assocs math kernel sequences io.files hashtables
 | 
			
		||||
quotations splitting arrays math.parser combinators.lib hash2
 | 
			
		||||
quotations splitting arrays math.parser hash2
 | 
			
		||||
byte-arrays words namespaces words compiler.units parser io.encodings.ascii  ;
 | 
			
		||||
IN: unicode.data
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -44,7 +44,7 @@ IN: unicode.data
 | 
			
		|||
    dup [ swap (chain-decomposed) ] curry assoc-map ;
 | 
			
		||||
 | 
			
		||||
: first* ( seq -- ? )
 | 
			
		||||
    second [ empty? ] [ first ] either ;
 | 
			
		||||
    second dup empty? [ ] [ first ] ?if ;
 | 
			
		||||
 | 
			
		||||
: (process-decomposed) ( data -- alist )
 | 
			
		||||
    5 swap (process-data)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,4 @@
 | 
			
		|||
USING: sequences namespaces unicode.data kernel combinators.lib
 | 
			
		||||
math arrays ;
 | 
			
		||||
USING: sequences namespaces unicode.data kernel math arrays ;
 | 
			
		||||
IN: unicode.normalize
 | 
			
		||||
 | 
			
		||||
! Conjoining Jamo behavior
 | 
			
		||||
| 
						 | 
				
			
			@ -19,7 +18,7 @@ IN: unicode.normalize
 | 
			
		|||
 | 
			
		||||
! These numbers come from UAX 29
 | 
			
		||||
: initial? ( ch -- ? )
 | 
			
		||||
    [ HEX: 1100 HEX: 1159 ?between? ] [ HEX: 115F = ] either ;
 | 
			
		||||
    dup HEX: 1100 HEX: 1159 ?between? [ ] [ HEX: 115F = ] ?if ;
 | 
			
		||||
: medial? ( ch -- ? ) HEX: 1160 HEX: 11A2 ?between? ;
 | 
			
		||||
: final? ( ch -- ? ) HEX: 11A8 HEX: 11F9 ?between? ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue