File tree Expand file tree Collapse file tree 3 files changed +86
-0
lines changed
Expand file tree Collapse file tree 3 files changed +86
-0
lines changed Original file line number Diff line number Diff line change 1+ # Byte-compiled / optimized / DLL files
2+ __pycache__ /
3+ * .py [cod ]
4+
5+ * .db
6+ * .sqlite3
7+ .installed.cfg
8+ parts
9+ develop-eggs
10+ bin
11+ eggs
12+ downloads
13+ lib
14+ lib64
15+ build
16+ .project
17+ .pydevproject
18+ include
19+ .settings
20+ TAGS
21+ .idea
22+ Include
23+ Lib
24+ .env
25+ Procfile
26+ tmp
27+ .Python
28+ local.cfg
29+ _build
30+ pip-selfcheck.json
31+ pyvenv.cfg
32+ geckodriver.log
33+
34+ # Various junk and temp files
35+ .DS_Store
36+ * ~
37+ . * .sw [po ]
38+ .build
39+ .ve
40+ * .bak
41+ var
42+ share
43+ selenium
44+ local
45+ dist /
46+ target /
47+ /. * cache /
48+ venv /
49+ .python-version
50+ /.pytest_cache /
51+ /scancodeio.egg-info /
52+ * .rdb
53+ * .aof
54+ .vscode
55+ .ipynb_checkpoints
56+
57+ # This is only created when packaging for external redistribution
58+ /thirdparty /
Original file line number Diff line number Diff line change 1+ pkg:maven/foobar
2+ pkg:npm/foo/bar
Original file line number Diff line number Diff line change 1+ use fst:: SetBuilder ;
2+ use std:: fs:: File ;
3+ use std:: io:: { BufRead , BufReader } ;
4+ use std:: path:: Path ;
5+
6+
7+ fn main ( ) {
8+ let input_file = Path :: new ( "fst_builder/data/purls.txt" ) ;
9+ let output_file = Path :: new ( "purls.fst" ) ;
10+
11+ let file = File :: create ( output_file) . expect ( "Cannot create FST file" ) ;
12+ let mut builder = SetBuilder :: new ( file) . expect ( "Failed to create FST builder" ) ;
13+
14+ let f = File :: open ( input_file) . expect ( "Cannot open input file" ) ;
15+ let reader = BufReader :: new ( f) ;
16+
17+ for line in reader. lines ( ) {
18+ let s = line. expect ( "Failed to read line" ) ;
19+ if !s. is_empty ( ) {
20+ builder. insert ( & s) . unwrap ( ) ;
21+ }
22+ }
23+
24+ builder. finish ( ) . expect ( "Failed to finish FST" ) ;
25+ println ! ( "FST generated at {:?}" , output_file) ;
26+ }
You can’t perform that action at this time.
0 commit comments