From d4b47612e1013b9e6d03ed6fa60e7e7f1fb1fd89 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Fri, 15 Mar 2013 08:26:01 -0700 Subject: [PATCH] geo-ip: fixing csv. --- extra/geo-ip/geo-ip.factor | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/extra/geo-ip/geo-ip.factor b/extra/geo-ip/geo-ip.factor index a28951901a..d63f01aaf2 100644 --- a/extra/geo-ip/geo-ip.factor +++ b/extra/geo-ip/geo-ip.factor @@ -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 csv + [ "#" head? not ] filter "\n" join string>csv [ parse-ip-entry ] map ; : filter-overlaps ( alist -- alist' )