! Copyright (C) 2009 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license.
-USING: sequences splitting kernel math.parser io.files io.encodings.ascii
+USING: sequences splitting kernel math.parser io.files io.encodings.utf8
biassocs ascii ;
IN: simple-flat-file
drop-comments [ parse-line ] map ;
: flat-file>biassoc ( filename -- biassoc )
- ascii file-lines process-codetable-lines >biassoc ;
+ utf8 file-lines process-codetable-lines >biassoc ;
: split-; ( line -- array )
";" split [ [ blank? ] trim ] map ;
-USING: tools.test kernel unicode.categories words sequences unicode.syntax ;
+! Copyright (C) 2008 Daniel Ehrenberg.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test kernel unicode.categories words sequences unicode.data ;
+IN: unicode.categories.tests
[ { f f t t f t t f f t } ] [ CHAR: A {
blank? letter? LETTER? Letter? digit?
USING: unicode.normalize kernel tools.test sequences
-unicode.data io.encodings.utf8 io.files splitting math.parser
+simple-flat-file io.encodings.utf8 io.files splitting math.parser
locals math quotations assocs combinators unicode.normalize.private ;
IN: unicode.normalize.tests
[ "\u00d55c" ] [ "\u001112\u001161\u0011ab" nfc ] unit-test
: parse-test ( -- tests )
- "vocab:unicode/normalize/NormalizationTest.txt"
- utf8 file-lines filter-comments
- [ ";" split 5 head [ " " split [ hex> ] "" map-as ] map ] map ;
+ "vocab:unicode/normalize/NormalizationTest.txt" data
+ [ 5 head [ " " split [ hex> ] "" map-as ] map ] map ;
:: assert= ( test spec quot -- )
spec [