Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(617)

Side by Side Diff: net/tools/dafsa/make_dafsa.py

Issue 1303973009: [DO NOT COMMIT] Re-use the dafsa code for s-w-r histograms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to fix patch errors on try bots. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """ 6 """
7 A Deterministic acyclic finite state automaton (DAFSA) is a compact 7 A Deterministic acyclic finite state automaton (DAFSA) is a compact
8 representation of an unordered word list (dictionary). 8 representation of an unordered word list (dictionary).
9 9
10 http://en.wikipedia.org/wiki/Deterministic_acyclic_finite_state_automaton 10 http://en.wikipedia.org/wiki/Deterministic_acyclic_finite_state_automaton
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 if len(sys.argv) != 3: 460 if len(sys.argv) != 3:
461 print('usage: %s infile outfile' % sys.argv[0]) 461 print('usage: %s infile outfile' % sys.argv[0])
462 return 1 462 return 1
463 with open(sys.argv[1], 'r') as infile, open(sys.argv[2], 'w') as outfile: 463 with open(sys.argv[1], 'r') as infile, open(sys.argv[2], 'w') as outfile:
464 outfile.write(words_to_cxx(parse_gperf(infile))) 464 outfile.write(words_to_cxx(parse_gperf(infile)))
465 return 0 465 return 0
466 466
467 467
468 if __name__ == '__main__': 468 if __name__ == '__main__':
469 sys.exit(main()) 469 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698