-
Notifications
You must be signed in to change notification settings - Fork 8
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
Optionally analyze compound word parts #8
Conversation
Täytyy nyt ainakin releasen versionumerot katsoa. Readme:n voisi ehkä myös näistä jotain versioista satuilla. |
ed16e2b
to
bb705a5
Compare
List<String> baseFormParts = analysis.getBaseFormParts(); | ||
|
||
if (baseForm != null && !results.contains(baseForm)) { | ||
results.add(baseForm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alla tsekataan duplikaatit, mutta tässä ei. Pitäisikö?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En ymmärrä kommenttia. Duplikaattia on yritetty ainakin tarkastaa, mutta onkohan implementaatiossa siis joku bugi?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En mä vaan tiedä, varmaan silmät harittaa jotenkin. 😄
} | ||
} | ||
} | ||
} | ||
|
||
switch (results.size()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nykyisellään tää switch ei enää aiheuta kuin overheadia; results
:n voisi palauttaa suoraan. Aiemmin se oli vain allokoinnin vähentämistä tilanteessa jossa tuloksia ei tullut lainkaan.
Mutta ehkä tässäkin voisi vielä ennen luuppia sanoa:
List<Analysis> analysisResults = raudikkoAnalyzer.analyze(word);
if (analysisResults.isEmpty())
return emptyList();
Toiminnallisesti ihan sama kuin ilmankin, mutta välttää sekä iteraattorin että tuloslistan allokoinnin. (Iteraattori nyt varmaan menee escape analyysillä stackiin, mutta silti.)
Ei nyt normaalissa koodissa viitsisi tällä tasolla viilata, mutta kun tätä kutsutaan kymmeniä miljoonia kertoja, niin kaikki on plussaa.
bb705a5
to
03344d2
Compare
List<String> baseFormParts = analysis.getBaseFormParts(); | ||
|
||
if (baseForm != null && !results.contains(baseForm)) { | ||
results.add(baseForm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En mä vaan tiedä, varmaan silmät harittaa jotenkin. 😄
No description provided.