-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor .extract_words and allow attrib-grouping
This commit refactors and hopefully makes clearer the logic in utils.extract_words. It also adds a new parameter, `extra_attrs`, which allows the user to pass a list of attributes on which to group all characters. For instance, passing `extra_attrs=["fontname", "size"]` will not allow characters with different font names or sizes to become part of the same word. As a benefit, those resulting word dicts will contain `"fontname"` and `"size"` attributes — providing a long-requested feature (cf. issue
- Loading branch information
Showing
3 changed files
with
85 additions
and
59 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