]> gitweb.factorcode.org Git - factor.git/blob - basis/simple-flat-file/simple-flat-file-docs.factor
Fixes #2966
[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: arrays biassocs help.syntax help.markup interval-maps
4 strings ;
5 IN: simple-flat-file
6
7 ABOUT: "simple-flat-file"
8
9 ARTICLE: "simple-flat-file" "Parsing simple flat files"
10 "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."
11 { $subsections
12     load-codetable-file
13     load-interval-file
14     load-data-file
15 } ;
16
17 HELP: load-interval-file
18 { $values { "filename" string } { "table" interval-map } }
19 { $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." } ;
20
21 HELP: load-data-file
22 { $values { "filename" string } { "data" array } }
23 { $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." } ;
24
25 HELP: load-codetable-file
26 { $values { "filename" string } { "biassoc" biassoc } }
27 { $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." } ;