Closed abheesht17 closed 4 years ago
@abheesht17 use black formatting for all the python code for a succesul build
Merging #50 into master will increase coverage by
0.21%
. The diff coverage is91.89%
.
@@ Coverage Diff @@
## master #50 +/- ##
==========================================
+ Coverage 90.90% 91.12% +0.21%
==========================================
Files 5 6 +1
Lines 132 169 +37
==========================================
+ Hits 120 154 +34
- Misses 12 15 +3
Impacted Files | Coverage Δ | |
---|---|---|
decepticonlp/transforms/paraphrase.py | 91.89% <91.89%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 2ec6c04...d606064. Read the comment docs.
Done, @rajaswa
You can reduce the code and make it easier to understand by passing all regex into a list and looping around them.
contractions=[(r"'ve"," have"), (r"n't", " not") ......]
for contraction in contractions:
re.sub(contraction[0], contraction[1], text .... )
This way it will be easier to add other regexes in future
Cool, I'll do that, @someshsingh22.
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities (and 0 Security Hotspots to review)
0 Code Smells
I have added the contractions part, both for expanded phrase-->contraction and contraction-->expanded words.
In the future, to improve this, we can implement PoS tagging, because right now, it will not be grammatically correct for certain contractions.