incubator-ctakes-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kim Ebert (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CTAKES-146) cTAKES doesn't identify SNOWMED codes consistently
Date Wed, 06 Feb 2013 16:47:12 GMT

    [ https://issues.apache.org/jira/browse/CTAKES-146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13572557#comment-13572557
] 

Kim Ebert commented on CTAKES-146:
----------------------------------

Here is an alternate patch to avoid cloning the object as often.

=== modified file 'src/edu/mayo/bmi/lookup/algorithms/FirstTokenPermutationImpl.java'
--- src/edu/mayo/bmi/lookup/algorithms/FirstTokenPermutationImpl.java   2012-11-28 01:56:50
+0000
+++ src/edu/mayo/bmi/lookup/algorithms/FirstTokenPermutationImpl.java   2013-02-06 16:39:37
+0000
@@ -294,14 +294,16 @@
                         Iterator mdhIterator = mdhSet.iterator();
                         while (mdhIterator.hasNext())
                         {
-                            MetaDataHit mdh = (MetaDataHit) mdhIterator.next();
+                            MetaDataHit mdh = (MetaDataHit) mdhIterator.next();
+
+                            List permutationSorted = (List) ((ArrayList)permutation).clone();
                             // figure out start and end offsets
-                            Collections.sort(permutation);
+                            Collections.sort(permutationSorted);

                             int startOffset;
-                            if (permutation.size() > 0)
+                            if (permutationSorted.size() > 0)
                             {
-                                int firstIdx = ((Integer) permutation.get(0)).intValue();
+                                int firstIdx = ((Integer) permutationSorted.get(0)).intValue();
                                 if (firstIdx <= firstTokenIndex.intValue())
                                 {
                                     firstIdx--;
@@ -322,9 +324,9 @@
                             }

                             int endOffset;
-                            if (permutation.size() > 0)
+                            if (permutationSorted.size() > 0)
                             {
-                                int lastIdx = ((Integer) permutation.get(permutation.size()
- 1)).intValue();
+                                int lastIdx = ((Integer) permutationSorted.get(permutationSorted.size()
- 1)).intValue();
                                 if (lastIdx <= firstTokenIndex.intValue())
                                 {
                                     lastIdx--;

                
> cTAKES doesn't identify SNOWMED codes consistently
> --------------------------------------------------
>
>                 Key: CTAKES-146
>                 URL: https://issues.apache.org/jira/browse/CTAKES-146
>             Project: cTAKES
>          Issue Type: Bug
>          Components: ctakes-dictionary-lookup
>    Affects Versions: 2.6-incubating, 3.0-incubating, future enhancement, 3.1-incubating
>            Reporter: Kim Ebert
>
> When running an identical document through in a single run through cTAKES, different
SNOWMED codes are identified for the same document.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message