def analyze_file(filename): names_dict = {} with open(filename) as f: for line in f: increment_count_dict(names_dict, namere.find_names(line)) return names_dict
def test_two_name(self): corpus = "Lorem ipsum dolor sit amet Justin Kim" names = namere.find_names(corpus) assert "Justin Kim" in names
def test_three_name_lowercase_middle(self): corpus = "Ludwig van Beethoven" names = namere.find_names(corpus) assert "Ludwig van Beethoven" in names
def test_three_name(self): corpus = "Harrison Parker Chiu" names = namere.find_names(corpus) assert "Harrison Parker Chiu" in names
def test_mc(self): corpus = "Stephen McClellan" names = namere.find_names(corpus) assert "Stephen McClellan" in names
def test_o_apostrophe(self): corpus = "Steven O'Malley" names = namere.find_names(corpus) assert "Steven O'Malley" in names