Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering the empty strings from substring array #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RohitPingale
Copy link

It's easy Removing the Empty string created in the final array. It's very hard to implement the function like .strip() in here because we are just substituting the strings in place of delimiters.

@codecov-io
Copy link

codecov-io commented Oct 11, 2019

Codecov Report

Merging #37 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #37   +/-   ##
=======================================
  Coverage   94.09%   94.09%           
=======================================
  Files          10       10           
  Lines         525      525           
=======================================
  Hits          494      494           
  Misses         31       31
Impacted Files Coverage Δ
src/sentences/sentence_splitting.jl 98.11% <100%> (ø) ⬆️

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 45f4aa3...cc6f76f. Read the comment docs.

@oxinabox
Copy link
Member

Option 1 (Your implementation):

    sentences = split(sentences, "\n")
    filter!(e-> e ≠ "", sentences)

Option 2

    sentences = split(sentences, "\n"; keepempty=false)

Option 3

    sentences = rstrip(sentences, '\n')
    split(sentences)

@RohitPingale
Copy link
Author

I would like to go with option 2 because it's cleaner and compact. and I think this particular case issue is solved.

@oxinabox
Copy link
Member

oxinabox commented Feb 5, 2020

Sorry, I lost track of this PR.
@RohitPingale can you update me on its status?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants