test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
classname-blmflt.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 import pydablooms
3 CAPACITY=5000
4 ERROR_RATE=float(1)/CAPACITY
5 bloom = pydablooms.Dablooms(capacity=CAPACITY, error_rate=ERROR_RATE,filepath='bloom.bin')
6 
7 f = open('classes.txt','r')
8 g = open('classnames.txt','w')
9 for line in f :
10  fields = line.split("'")
11  if fields[0] == 'class ' :
12  g.write(fields[1]+'\n')
13 
14 f.close()
15 g.close()
16 h = open('classnames.txt','rb')
17 i = 0
18 for line in h:
19  bloom.add(line.rstrip(), i)
20  i += 1
21 
22 bloom.flush()
23