-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update name normalization to account for alternative utterance matches
Add unit test coverage for name normalization
- Loading branch information
1 parent
4b339f7
commit e0dcc4d
Showing
2 changed files
with
36 additions
and
11 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1537,6 +1537,24 @@ def test_spoken_email(self): | |
self.assertEqual(self.skill._spoken_email("[email protected]"), | ||
"my dot email at domain dot com") | ||
|
||
def test_normalize_name(self): | ||
valid_name = "Daniel" | ||
invalid_punctuation = "Daniel ." | ||
invalid_with_quotes = 'daniel "' | ||
invalid_with_number = "DANIEL 1 2 3" | ||
|
||
self.assertEqual(self.skill._normalize_name(invalid_punctuation), | ||
valid_name) | ||
self.assertEqual(self.skill._normalize_name(invalid_with_quotes), | ||
valid_name) | ||
self.assertEqual(self.skill._normalize_name(invalid_with_number), | ||
valid_name) | ||
|
||
valid_full_name = "D-J Mcknight" | ||
uncleaned_name = "d-j mcknight . " | ||
self.assertEqual(self.skill._normalize_name(uncleaned_name), | ||
valid_full_name) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |