Skip to content

Conversation

Euak
Copy link
Contributor

@Euak Euak commented Jan 7, 2019

Hello, @yooper !
@thiagogomesverissimo and I worked some things on the concordance method.

  • We uncoupled concordance function. We created: a method that only returns the positions of the needle in the text; a method that marks a needle in a string and a method that returns an excerpt from a string.
  • Improved the regex used to find the needle. Changed negated set to negative lookahead and lookbehind. This way it will capture correctly groups at the beginning of the string and at the
    end of the string without the need to add spaces.
  • And fixed the text variable so it won't convert a string with ISO-8859-1 if the method

If you have any questions or suggestions, feel free to ask me or @thiagogomesverissimo .
Thank you.

Euak added 6 commits January 2, 2019 16:32
Separated in different functions for getting term positions and
extracting the desired context. Also added the option to mark the term.
Changed negated set to negative lookahead and lookbehind. This way it
will capture correctly groups at the beginning of the string and at the
end of the string without the need to add spaces.
Assigned a temp variable for the converted corpus text (ISO-8859-1) instead of
changing the attribute. It will prevent to convert an already converted
corpus text.
Added parameter tags to the methods markString and getExcerpt.
Separated from concordance method the code block that finds the needle
positions and the code block that extract an excerpt of the text. Also included option to mark the needle to the returned text.
Removed extractExcerptTerm method that was not used anymore.
@yooper
Copy link
Owner

yooper commented Jan 8, 2019

Thanks, I will check it out this week and get back to you.

@yooper
Copy link
Owner

yooper commented Jan 14, 2019

Thanks for the contribution

@yooper yooper merged commit a446020 into yooper:master Jan 14, 2019
@thiagogomesverissimo
Copy link
Contributor

Nice @yooper 🐺

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