[Groonga-commit] groonga/gcs [master] Report the count of the loaded synonyms

Back to archive index

null+****@clear***** null+****@clear*****
2012年 8月 9日 (木) 15:29:33 JST


SHIMODA Hiroshi	2012-08-09 15:29:33 +0900 (Thu, 09 Aug 2012)

  New Revision: d35ae6366fc46900b1a96bff619c8903563352ab
  https://github.com/groonga/gcs/commit/d35ae6366fc46900b1a96bff619c8903563352ab

  Log:
    Report the count of the loaded synonyms

  Modified files:
    bin/gcs-configure-text-options

  Modified: bin/gcs-configure-text-options (+3 -1)
===================================================================
--- bin/gcs-configure-text-options    2012-08-09 15:26:27 +0900 (175e8e4)
+++ bin/gcs-configure-text-options    2012-08-09 15:29:33 +0900 (6cc7f5b)
@@ -62,9 +62,11 @@ if (commandLine.options.printStems) {
     synonymsCSV.split('\n').forEach(function(synonym) {
       var terms = synonym.split(',');
       var key = terms.shift();
-      synonyms[key] = terms;
+      var previousTerms = synonyms[key] || [];
+      synonyms[key] = previousTerms.concat(terms);
     });
     commandLine.domain.updateSynonymsSync(synonyms);
+    console.log('%s synonyms are loaded.', Object.keys(synonyms).length);
   }
 }
 
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
다운로드 



Groonga-commit メーリングリストの案内
Back to archive index