Commit adbd962b authored by Dos Santos David's avatar Dos Santos David

prefix graph filenames with the collection

parent d5248def
......@@ -5,9 +5,10 @@ from gogole.parser.cacm_parser import CACMParser
from gogole.tokenizer.simple_tokenizer import SimpleTokenizer
class CACMCollection(Collection):
NAME = 'cacm'
def __init__(self):
# BSBI indexer with single block
self._indexer = BSBIIndexer('cacm', maxsize=None)
self._indexer = BSBIIndexer(self.NAME, maxsize=None)
self._parser = CACMParser()
......
......@@ -5,9 +5,11 @@ from gogole.parser.stanford_parser import StanfordParser
from gogole.tokenizer.no_tokenizer import NoTokenizer
class StanfordCollection(Collection):
NAME = 'stanford'
def __init__(self):
# BSBI indexer with single block
self._indexer = BSBIIndexer('stanford', maxsize=16*1024*1024)
self._indexer = BSBIIndexer(self.NAME, maxsize=16*1024*1024)
self._parser = StanfordParser()
......
......@@ -67,7 +67,7 @@ def run(collection, args):
plot_bar(
x,
heights,
filename='zipf_law.png',
filename='graphs/{}_zipf_law.png'.format(collection.NAME),
xlabel="rank",
ylabel="frequency"
)
......@@ -75,7 +75,7 @@ def run(collection, args):
plot_bar(
list(map(math.log10, x)),
list(map(math.log10, heights)),
filename='zipf_law_logs.png',
filename='graphs/{}_zipf_law_logs.png'.format(collection.NAME),
xlabel='log10(rank)',
ylabel='log10(frequency)'
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment