This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
uniqu_words = {} | |
total_word_count = 0 | |
inFile = open(sys.argv[1],'r') | |
for line in inFile: | |
tokens = line.split() | |
for word in tokens: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, math | |
MAX_LENGTH = 200 | |
if(len(sys.argv)<3): | |
sys.exit('input 2 files!') | |
f1 = open(sys.argv[1],'r').readlines() | |
f2 = open(sys.argv[2], 'r').readlines() | |
f_a = [[] for y in range(MAX_LENGTH)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To run: python corpusShuffler -src sourceCourpus.txt -tdt targetCorpus.txt | |
import argparse | |
import random | |
parser = argparse.ArgumentParser(description='## CORPUS SHUFLER ##') | |
parser.add_argument( | |
'-src', help='sorce language corpus to shuffle', required=True) | |
parser.add_argument( | |
'-tgt', help='target language corpus to shuffle', required=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Vector; | |
import javax.swing.DefaultComboBoxModel; | |
import javax.swing.JComboBox; | |
import javax.swing.JTextField; | |
public class AutoComboBox extends JComboBox<Object> { | |
// default item list | |
String keyWord[] = {"item1", "item2", "item3"}; | |