-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from mammothb/build/fix-dependency
Build/fix dependency
- Loading branch information
Showing
20 changed files
with
1,785 additions
and
1,772 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# format all | ||
b0abc5ed3a37b05848ca1e2de790321d7c07fd75 |
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 @@ | ||
*.py eol=lf |
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 |
---|---|---|
@@ -1,26 +1,26 @@ | ||
# MIT License | ||
# | ||
# Copyright (c) 2022 mmb L (Python port) | ||
# Copyright (c) 2021 Wolf Garbe (Original C# implementation) | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
|
||
"""symspellpy | ||
.. moduleauthor:: mmb L <[email protected]> | ||
.. moduleauthor:: Wolf Garbe <[email protected]> | ||
""" | ||
|
||
__version__ = "6.7.7" | ||
|
||
from . import editdistance, helpers, logging | ||
from .symspellpy import SymSpell | ||
from .verbosity import Verbosity | ||
# MIT License | ||
# | ||
# Copyright (c) 2022 mmb L (Python port) | ||
# Copyright (c) 2021 Wolf Garbe (Original C# implementation) | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
|
||
"""symspellpy | ||
.. moduleauthor:: mmb L <[email protected]> | ||
.. moduleauthor:: Wolf Garbe <[email protected]> | ||
""" | ||
|
||
__version__ = "6.7.7" | ||
|
||
from . import editdistance, helpers, logging | ||
from .symspellpy import SymSpell | ||
from .verbosity import Verbosity |
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 |
---|---|---|
@@ -1,57 +1,57 @@ | ||
# MIT License | ||
# | ||
# Copyright (c) 2022 mmb L (Python port) | ||
# Copyright (c) 2021 Wolf Garbe (Original C# implementation) | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
|
||
""" | ||
.. module:: compostiion | ||
:synopsis: Data class for :meth:`symspellpy.symspellpy.word_segmentation`. | ||
""" | ||
|
||
from typing import NamedTuple | ||
|
||
|
||
class Composition(NamedTuple): | ||
"""Used by :meth:`word_segmentation`. | ||
Attributes: | ||
segmented_string: The word segmented string. | ||
corrected_string: The spelling corrected string. | ||
distance_sum: The sum of edit distance between input string and | ||
corrected string | ||
log_prob_sum: The sum of word occurrence probabilities in log | ||
scale (a measure of how common and probable the corrected | ||
segmentation is). | ||
""" | ||
|
||
segmented_string: str = "" | ||
corrected_string: str = "" | ||
distance_sum: int = 0 | ||
log_prob_sum: float = 0 | ||
|
||
@classmethod | ||
def create( | ||
cls, | ||
composition: "Composition", | ||
segmented_part: str, | ||
corrected_part: str, | ||
distance: int, | ||
log_prob: float, | ||
) -> "Composition": | ||
"""Creates a Composition by appending to an existing Composition.""" | ||
return cls( | ||
composition.segmented_string + segmented_part, | ||
composition.corrected_string + corrected_part, | ||
composition.distance_sum + distance, | ||
composition.log_prob_sum + log_prob, | ||
) | ||
# MIT License | ||
# | ||
# Copyright (c) 2022 mmb L (Python port) | ||
# Copyright (c) 2021 Wolf Garbe (Original C# implementation) | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
|
||
""" | ||
.. module:: compostiion | ||
:synopsis: Data class for :meth:`symspellpy.symspellpy.word_segmentation`. | ||
""" | ||
|
||
from typing import NamedTuple | ||
|
||
|
||
class Composition(NamedTuple): | ||
"""Used by :meth:`word_segmentation`. | ||
Attributes: | ||
segmented_string: The word segmented string. | ||
corrected_string: The spelling corrected string. | ||
distance_sum: The sum of edit distance between input string and | ||
corrected string | ||
log_prob_sum: The sum of word occurrence probabilities in log | ||
scale (a measure of how common and probable the corrected | ||
segmentation is). | ||
""" | ||
|
||
segmented_string: str = "" | ||
corrected_string: str = "" | ||
distance_sum: int = 0 | ||
log_prob_sum: float = 0 | ||
|
||
@classmethod | ||
def create( | ||
cls, | ||
composition: "Composition", | ||
segmented_part: str, | ||
corrected_part: str, | ||
distance: int, | ||
log_prob: float, | ||
) -> "Composition": | ||
"""Creates a Composition by appending to an existing Composition.""" | ||
return cls( | ||
composition.segmented_string + segmented_part, | ||
composition.corrected_string + corrected_part, | ||
composition.distance_sum + distance, | ||
composition.log_prob_sum + log_prob, | ||
) |
Oops, something went wrong.