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

Fixing several bugs in the microservice implementation #273

Merged
merged 17 commits into from
Sep 22, 2023

Conversation

Gram21
Copy link
Member

@Gram21 Gram21 commented Sep 20, 2023

This hotfix targets several issues in the microservice implementation that were uncovered recently after the microservice was actually used and initial bugs were fixed in the commits 7b35c21 and 0661657:

  1. Bug in the TextImpl.getLength() for the microservice version: The previous version returned the String length, not the number of words.
  2. Implementing a POST request (together with the corresponding one in the actual microservice) as long texts exceeded the maximum URI-length (as the text was provided as request parameter), causing a http exception.
  3. The JSON schema (and the class) was missing a few POS-tags, causing an exception during deconstruction. At the same time, removed the duplicate PosTag enum as it was basically duplicate code.
  4. Improved the performance for some implementation of Text/Word/Phrase/Sentence to use lazy initialization and storing some values instead of calculating them each time.
  5. Removed a cyclic dependency in the equals and hashcode of WordImpl of the microservice. Now, the previous and next words are not part of these as otherwise all words of the whole text needs to be compared each time when comparing two words.

Gram21 and others added 12 commits September 18, 2023 10:53
Due to a mistake when calculating the length (mistakenly calculating string length, not word length), the last word in a text had the problem of raising an exception because the check if there is a next word did go wrong (as the nextWordIndex was always smaller than the actual maximum index in the words list)
@Gram21 Gram21 marked this pull request as ready for review September 20, 2023 11:44
…doco/core/text/providers/informants/corenlp/textprocessor/HttpCommunicator.java

Co-authored-by: Dominik Fuchß <dominik.fuchss@kit.edu>
@Gram21 Gram21 requested a review from dfuchss September 22, 2023 08:09
…doco/core/text/providers/informants/corenlp/textprocessor/HttpCommunicator.java

Co-authored-by: Dominik Fuchß <dominik.fuchss@kit.edu>
@Gram21 Gram21 merged commit cfdd51e into main Sep 22, 2023
7 checks passed
@Gram21 Gram21 deleted the hotfix/microservice_usage branch September 22, 2023 12:09
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

76.3% 76.3% Coverage
0.0% 0.0% Duplication

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.

2 participants