question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Punctuations getting removed

See original GitHub issue

Hello. Great work!

For inputs with punctuations, There are many novel, innovaive, and empirical anayysis availaible. we get outputs like there are many novel innovative and empirical analysis available. Is it possible to keep the punctuations?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
duhaimecommented, May 13, 2020

It’s a shame this is closed–keeping punctuation is pretty vital to the integrity of language…

0reactions
alvesmancommented, Dec 9, 2020

My phrase spell checker preserving punctuation: ` import re word_split = re.compile(r"[^\W]+", re.U)

def spell_corrected(term): suggestions = sym_spell.lookup_compound( term, max_edit_distance=2, # The maximum edit distance between input and suggested words. ignore_non_words=True, # numbers and acronyms are left alone split_phrase_by_space=True, # otherwise hyphen words will be split https://github.com/wolfgarbe/SymSpell/issues/85 ignore_term_with_digits=True # any term with digits is left alone )

corrected = suggestions[0].term
# This combined with split_phrase_by_space=True would be enough just to spell check
# but punctuation is lost.

# The spell check is already done in 'corrected'. Now we just want to keep the punctuation.
in_list = word_split.findall(term)
chk_list = word_split.findall(corrected)

# To keep punctuation we take the original phrase and do word by word replacement
out_term = term
word_count = 0
for word in in_list:
    out_term = out_term.replace(word, chk_list[word_count])
    word_count += 1

return out_term

`

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove Punctuation Characters - Online - Browserling
Useful, free online tool that removes all punctuation from text. No ads, nonsense, or garbage, just a punctuation remover. Press a button –...
Read more >
Python: Remove Punctuation from a String (3 Different Ways!)
In this tutorial, you'll learn how to use Python to remove punctuation from a string. You'll learn how to strip punctuation from a...
Read more >
Removing punctuations from a given string - GeeksforGeeks
Approach: First check the input string if it consists of punctuations then we have to make it punctuation free. In order to do...
Read more >
Python Program to Remove Punctuations From a String
This program removes all punctuations from a string. We will check each character of the string using for loop. If the character is...
Read more >
Remove All Punctuation Characters from Text
Super simple, free and fast browser-based utility for removing all punctuation from text. Just paste your text and you'll instantly get clean text....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found