minor fix
This commit is contained in:
		
							parent
							
								
									abb033a9b8
								
							
						
					
					
						commit
						2f7ab3b9cf
					
				| @ -220,7 +220,7 @@ public class Datahandler { | ||||
|                 hlStatsMessages.put(str, hlStatsMessages.size()); | ||||
|             } | ||||
|         } | ||||
|         int capacity = 1250; | ||||
|         int capacity = 250; | ||||
|         hlStatsMessages.keySet().forEach(str -> { | ||||
|             if (!str.startsWith("!") && MessageResponseHandler.getStr().values().size() < capacity) { | ||||
|                 String orElse = strCacheLocal.values().parallelStream().filter(e -> e.equals(str)).findAny().orElse(null); | ||||
| @ -305,11 +305,11 @@ public class Datahandler { | ||||
|     } | ||||
| 
 | ||||
|     private List<SimilarityMatrix> StrComparringNoSentenceRelationMap( | ||||
|             ConcurrentMap<Integer, String> strCacheLocal, Collection<String> str, ConcurrentMap<String, Annotation> localJMWEMap, | ||||
|             ConcurrentMap<Integer, String> strCacheLocal, Collection<String> strCollection, ConcurrentMap<String, Annotation> localJMWEMap, | ||||
|             ConcurrentMap<String, Annotation> localPipelineAnnotation, ConcurrentMap<String, Annotation> localPipelineSentimentAnnotation, | ||||
|             ConcurrentMap<String, CoreDocument> localCoreDocumentMap, CompletionService<SimilarityMatrix> ecs, int index) { | ||||
|         int prefix_size = 125; | ||||
|         SentimentValueCache sentimentCacheStr = sentimentCachingMap.getOrDefault(str, null); | ||||
|         SentimentValueCache sentimentCacheStr = sentimentCachingMap.getOrDefault(strCollection, null); | ||||
|         List<SimilarityMatrix> smxReturnList = new ArrayList(); | ||||
|         List<String> randomIterationComparision = new ArrayList(); | ||||
|         int iteratecap = strCacheLocal.size() > prefix_size ? strCacheLocal.size() - prefix_size : strCacheLocal.size(); | ||||
| @ -325,18 +325,18 @@ public class Datahandler { | ||||
|             iterated++; | ||||
|         } | ||||
|         for (String str1 : randomIterationComparision) { | ||||
|             for (String str2 : str) { | ||||
|                 if (!str2.equals(str1)) { | ||||
|                     SimilarityMatrix SMXInit = new SimilarityMatrix(str2, str1); | ||||
|             for (String str : strCollection) { | ||||
|                 if (!str.equals(str1)) { | ||||
|                     SimilarityMatrix SMXInit = new SimilarityMatrix(str, str1); | ||||
|                     SentimentValueCache sentimentCacheStr1 = sentimentCachingMap.getOrDefault(str1, null); | ||||
|                     Callable<SimilarityMatrix> worker; | ||||
|                     if (stringCache.size() < prefix_size) { | ||||
|                         worker = new SentimentAnalyzerTest(str2, str1, SMXInit, | ||||
|                         worker = new SentimentAnalyzerTest(str, str1, SMXInit, | ||||
|                                 localJMWEMap.get(str), localJMWEMap.get(str1), localPipelineAnnotation.get(str), | ||||
|                                 localPipelineAnnotation.get(str1), localPipelineSentimentAnnotation.get(str), | ||||
|                                 localPipelineSentimentAnnotation.get(str1), localCoreDocumentMap.get(str), localCoreDocumentMap.get(str1), sentimentCacheStr, sentimentCacheStr1); | ||||
|                     } else { | ||||
|                         worker = new SentimentAnalyzerTest(str2, str1, SMXInit, | ||||
|                         worker = new SentimentAnalyzerTest(str, str1, SMXInit, | ||||
|                                 localJMWEMap.get(str), jmweAnnotationCache.get(str1), localPipelineAnnotation.get(str), | ||||
|                                 pipelineAnnotationCache.get(str1), localPipelineSentimentAnnotation.get(str), | ||||
|                                 pipelineSentimentAnnotationCache.get(str1), localCoreDocumentMap.get(str), coreDocumentAnnotationCache.get(str1), sentimentCacheStr, sentimentCacheStr1); | ||||
| @ -350,8 +350,17 @@ public class Datahandler { | ||||
|             try { | ||||
|                 Future<SimilarityMatrix> take = ecs.take(); | ||||
|                 SimilarityMatrix smx = take.get(); | ||||
|                 if (smx != null && !smxReturnList.contains(smx)) { | ||||
|                     smxReturnList.add(smx); | ||||
|                 if (smx != null) { | ||||
|                     boolean present = false; | ||||
|                     for (SimilarityMatrix str_smx : smxReturnList) { | ||||
|                         if (str_smx.getPrimaryString().equals(smx.getPrimaryString())) { | ||||
|                             present = true; | ||||
|                             break; | ||||
|                         } | ||||
|                     } | ||||
|                     if (!present) { | ||||
|                         smxReturnList.add(smx); | ||||
|                     } | ||||
|                 } | ||||
|             } catch (InterruptedException | ExecutionException ex) { | ||||
|                 // | ||||
| @ -376,7 +385,7 @@ public class Datahandler { | ||||
|         //System.out.println("StrComparringNoSentenceRelationMap size: " + StrComparringNoSentenceRelationMap.size()); | ||||
|         Collections.sort(StrComparringNoSentenceRelationMap, (e1, e2) -> e1.getPrimaryString().compareTo(e2.getPrimaryString())); | ||||
|         ConcurrentMap<Integer, String> strmapreturn = futuresReturnOverallEvaluation(StrComparringNoSentenceRelationMap); | ||||
|         //System.out.println("strmapreturn size: " + strmapreturn.size()); | ||||
|         System.out.println("strmapreturn size: " + strmapreturn.size()); | ||||
|         return strmapreturn; | ||||
|     } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user