]> gitweb.factorcode.org Git - factor.git/commitdiff
geo-ip: fixing csv.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 15 Mar 2013 15:26:01 +0000 (08:26 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 15 Mar 2013 15:26:01 +0000 (08:26 -0700)
extra/geo-ip/geo-ip.factor

index a28951901aeb7f97117e56951b58be48b782a0f6..d63f01aaf232ebf72e60d78c82d139f7085e92ea 100644 (file)
@@ -1,10 +1,9 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel sequences io.files io.files.temp io.launcher
-io.pathnames io.encodings.ascii io.streams.string http.client
-generalizations combinators math.parser math.vectors
-math.intervals interval-maps memoize csv accessors assocs
-strings math splitting grouping arrays combinators.smart ;
+USING: accessors arrays assocs combinators combinators.smart
+csv grouping http.client interval-maps io.encodings.ascii
+io.files io.files.temp io.launcher io.pathnames kernel math
+math.parser math.vectors memoize sequences splitting strings ;
 IN: geo-ip
 
 : db-path ( -- path ) "IpToCountry.csv" cache-file ;
@@ -34,7 +33,7 @@ TUPLE: ip-entry from to registry assigned city cntry country ;
 
 MEMO: ip-db ( -- seq )
     download-db ascii file-lines
-    [ "#" head? not ] filter "\n" join <string-reader> csv
+    [ "#" head? not ] filter "\n" join string>csv
     [ parse-ip-entry ] map ;
 
 : filter-overlaps ( alist -- alist' )