forked from mindee/doctr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bug] Fix vocabs and add corresponding test case (mindee#1813)
changes with vocab and documentation dec 10
- Loading branch information
1 parent
394661f
commit bc1837e
Showing
3 changed files
with
20 additions
and
9 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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from collections import Counter | ||
|
||
from doctr.datasets import VOCABS | ||
|
||
|
||
def test_vocabs_duplicates(): | ||
for key, vocab in VOCABS.items(): | ||
assert isinstance(vocab, str) | ||
|
||
duplicates = [char for char, count in Counter(vocab).items() if count > 1] | ||
assert not duplicates, f"Duplicate characters in {key} vocab: {duplicates}" |