You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2014/07/02 01:43:27 UTC

git commit: refs/heads/264_dont_subclass_hash - Eliminate NoCloneHash; use a plain Hash instead.

Repository: lucy
Updated Branches:
  refs/heads/264_dont_subclass_hash [created] 1622b4e4f


Eliminate NoCloneHash; use a plain Hash instead.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/1622b4e4
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/1622b4e4
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/1622b4e4

Branch: refs/heads/264_dont_subclass_hash
Commit: 1622b4e4f55158e2a58d5caef8ace652a9f5830e
Parents: eb10a8c
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Jul 1 16:42:16 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Tue Jul 1 16:42:16 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Analysis/SnowballStopFilter.c   | 24 ++----------------------
 core/Lucy/Analysis/SnowballStopFilter.cfh | 11 -----------
 2 files changed, 2 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/1622b4e4/core/Lucy/Analysis/SnowballStopFilter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Analysis/SnowballStopFilter.c b/core/Lucy/Analysis/SnowballStopFilter.c
index efae12d..4e4c998 100644
--- a/core/Lucy/Analysis/SnowballStopFilter.c
+++ b/core/Lucy/Analysis/SnowballStopFilter.c
@@ -141,33 +141,13 @@ SnowStop_gen_stoplist(String *language) {
     }
     size_t num_stopwords = 0;
     for (uint32_t i = 0; words[i] != NULL; i++) { num_stopwords++; }
-    NoCloneHash *stoplist = NoCloneHash_new(num_stopwords);
+    Hash *stoplist = Hash_new(num_stopwords);
     for (uint32_t i = 0; words[i] != NULL; i++) {
         char *word = (char*)words[i];
         String *stop = Str_new_wrap_trusted_utf8(word, strlen(word));
-        NoCloneHash_Store(stoplist, (Obj*)stop, (Obj*)Str_newf(""));
+        Hash_Store(stoplist, (Obj*)stop, (Obj*)CFISH_TRUE);
         DECREF(stop);
     }
     return (Hash*)stoplist;
 }
 
-/***************************************************************************/
-
-NoCloneHash*
-NoCloneHash_new(uint32_t capacity) {
-    NoCloneHash *self = (NoCloneHash*)VTable_Make_Obj(NOCLONEHASH);
-    return NoCloneHash_init(self, capacity);
-}
-
-NoCloneHash*
-NoCloneHash_init(NoCloneHash *self, uint32_t capacity) {
-    return (NoCloneHash*)Hash_init((Hash*)self, capacity);
-}
-
-Obj*
-NoCloneHash_Make_Key_IMP(NoCloneHash *self, Obj *key, int32_t hash_sum) {
-    UNUSED_VAR(self);
-    UNUSED_VAR(hash_sum);
-    return INCREF(key);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1622b4e4/core/Lucy/Analysis/SnowballStopFilter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Analysis/SnowballStopFilter.cfh b/core/Lucy/Analysis/SnowballStopFilter.cfh
index 6d9f3dc..8dc9b28 100644
--- a/core/Lucy/Analysis/SnowballStopFilter.cfh
+++ b/core/Lucy/Analysis/SnowballStopFilter.cfh
@@ -105,14 +105,3 @@ public class Lucy::Analysis::SnowballStopFilter nickname SnowStop
     Destroy(SnowballStopFilter *self);
 }
 
-class Lucy::Analysis::SnowballStopFilter::NoCloneHash inherits Clownfish::Hash {
-    inert incremented NoCloneHash*
-    new(uint32_t capacity = 0);
-
-    inert NoCloneHash*
-    init(NoCloneHash *self, uint32_t capacity = 0);
-
-    public incremented Obj*
-    Make_Key(NoCloneHash *self, Obj *key, int32_t hash_sum);
-}
-