Changeset 1722 for proto


Ignore:
Timestamp:
Nov 21, 2011, 5:19:47 PM (8 years ago)
Author:
vla24
Message:

SymbolTable?: added a python script to turn the content of all input files (dictionary and text) into lowercase

Location:
proto/SymbolTable
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • proto/SymbolTable/common_definitions.h

    r1721 r1722  
    88#define DEBUG 0
    99#define PRINT_SYMBOL_DISTRIBUTION 0
     10#define PRINT_DICTIONARY_INFO 0
    1011#define SEGMENT_BLOCKS 12
    1112#define BUFFER_SIZE (BLOCK_SIZE * SEGMENT_BLOCKS)
  • proto/SymbolTable/src/Makefile

    r1721 r1722  
    6666clean:
    6767        rm -f $(OUTFILE) $(OUTFILE).s $(OUTFILE).o
     68        rm -f $(WCD_OUTFILE) $(WCD_OUTFILE).s $(WCD_OUTFILE).o
     69        rm -f *generated.*
    6870
  • proto/SymbolTable/src/perf_script_wcd.py

    r1721 r1722  
    22import os
    33from string import *
     4import run_wcd
    45
    56testfile_home = "../test/test_files/"
    67programs = ['wcd']
    78#TODO: Change the testfiles
    8 dictionaryfiles = ['test_dictionary.txt']
    9 testfiles = ['test_text.txt']
     9dictionaryfiles = ['test_dictionary.txt', 'test_dictionary.txt']
     10testfiles = ['test_text.txt', 'dict_bezier.txt']
    1011
    1112def run_test():     
     
    1314  for program in programs:
    1415    for index in range(len(testfiles)):
     16      dictionary_path = testfile_home+dictionaryfiles[index]
     17      text_path = testfile_home+testfiles[index]
     18      # convert files to lowercase
     19      dictionary_new_path = run_wcd.convert_file_to_lowercase(dictionary_path)
     20      text_new_path = run_wcd.convert_file_to_lowercase(text_path)
    1521      for i in range(10):
    16         call(['./'+program, testfile_home+dictionaryfiles[index], testfile_home+testfiles[index]], stderr=mes_f)
     22        call(['./wcd', dictionary_new_path, text_new_path], stderr=mes_f)
     23      run_wcd.delete_temporary_files(dictionary_new_path, text_new_path)
    1724
    1825def analyze_rslt():     
     
    2330      for r in results[:-1]:
    2431        results_int.append(int(r))
    25       first_row = '\t\t'
     32      first_row = '\t'
    2633      for testfile in testfiles:
    27         first_row += testfile + '  &\t'
     34        first_row += testfile + '  &\t'
    2835      first_row =  first_row[:-4]
    2936      print first_row
    3037      for program in programs:
    31         row = program + '   &\t'
     38        row = program + '   \t&\t'
    3239        for testfile in testfiles:
    3340          result = results_int[0:10]
  • proto/SymbolTable/wcd_common_functions.h

    r1721 r1722  
    4545void printWordCountInDictionary(const int totalUnknownWordsInDictionary, const int totalKnownWordsInDictionary)
    4646{
     47#if PRINT_DICTIONARY_INFO
    4748    printf ("%i known words, %i unknown words\n",totalKnownWordsInDictionary, totalUnknownWordsInDictionary);
     49#endif
    4850}
    4951
Note: See TracChangeset for help on using the changeset viewer.