]> gitweb.factorcode.org Git - factor.git/blob - basis/simple-flat-file/simple-flat-file-docs.factor
Solution to Project Euler problem 65
[factor.git] / basis / simple-flat-file / simple-flat-file-docs.factor
1 ! Copyright (C) 2009 Daniel Ehrenberg
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.syntax help.markup strings biassocs arrays ;
4 IN: simple-flat-file
5
6 ABOUT: "simple-flat-file"
7
8 ARTICLE: "simple-flat-file" "Parsing simple flat files"
9 "The " { $vocab-link "simple-flat-file" } " vocabulary provides words for loading and parsing simple flat files in a particular format which is common for encoding and Unicode tasks."
10 { $subsection flat-file>biassoc }
11 { $subsection load-interval-file }
12 { $subsection data } ;
13
14 HELP: load-interval-file
15 { $values { "filename" string } { "table" "an interval map" } }
16 { $description "This loads a file that looks like Script.txt in the Unicode Character Database and converts it into an efficient interval map, where the keys are characters and the values are strings for the properties." } ;
17
18 HELP: data
19 { $values { "filename" string } { "data" array } }
20 { $description "This loads a file that's delineated by semicolons and lines, returning an array of lines, where each line is an array split by the semicolons, with whitespace trimmed off." } ;
21
22 HELP: flat-file>biassoc
23 { $values { "filename" string } { "biassoc" biassoc } }
24 { $description "This loads a flat file, in the form that many encoding resource files are in, with two columns of numeric data in hex, and returns a biassoc associating them." } ;