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 ...@@ -5,9 +5,10 @@ from gogole.parser.cacm_parser import CACMParser
from gogole.tokenizer.simple_tokenizer import SimpleTokenizer from gogole.tokenizer.simple_tokenizer import SimpleTokenizer
class CACMCollection(Collection): class CACMCollection(Collection):
NAME = 'cacm'
def __init__(self): def __init__(self):
# BSBI indexer with single block # BSBI indexer with single block
self._indexer = BSBIIndexer('cacm', maxsize=None) self._indexer = BSBIIndexer(self.NAME, maxsize=None)
self._parser = CACMParser() self._parser = CACMParser()
......
...@@ -5,9 +5,11 @@ from gogole.parser.stanford_parser import StanfordParser ...@@ -5,9 +5,11 @@ from gogole.parser.stanford_parser import StanfordParser
from gogole.tokenizer.no_tokenizer import NoTokenizer from gogole.tokenizer.no_tokenizer import NoTokenizer
class StanfordCollection(Collection): class StanfordCollection(Collection):
NAME = 'stanford'
def __init__(self): def __init__(self):
# BSBI indexer with single block # 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() self._parser = StanfordParser()
......
...@@ -67,7 +67,7 @@ def run(collection, args): ...@@ -67,7 +67,7 @@ def run(collection, args):
plot_bar( plot_bar(
x, x,
heights, heights,
filename='zipf_law.png', filename='graphs/{}_zipf_law.png'.format(collection.NAME),
xlabel="rank", xlabel="rank",
ylabel="frequency" ylabel="frequency"
) )
...@@ -75,7 +75,7 @@ def run(collection, args): ...@@ -75,7 +75,7 @@ def run(collection, args):
plot_bar( plot_bar(
list(map(math.log10, x)), list(map(math.log10, x)),
list(map(math.log10, heights)), list(map(math.log10, heights)),
filename='zipf_law_logs.png', filename='graphs/{}_zipf_law_logs.png'.format(collection.NAME),
xlabel='log10(rank)', xlabel='log10(rank)',
ylabel='log10(frequency)' 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