From 368f0ade0a84c9c226b1ac1cca7f711b74216428 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Wed, 11 Mar 2026 17:13:44 -0700 Subject: [PATCH] Update: move const to types make code simpler --- consts/dict_file.go | 28 ---------------------------- dict_1.16.go | 5 +++-- dict_1.16_test.go | 3 +-- hmm/extracker/tag_extracker.go | 5 ++--- hmm/relevance/bm25.go | 13 ++++++------- hmm/relevance/tfidf.go | 5 ++--- types/dict_file.go | 27 +++++++++++++++++++++++++++ 7 files changed, 41 insertions(+), 45 deletions(-) delete mode 100644 consts/dict_file.go diff --git a/consts/dict_file.go b/consts/dict_file.go deleted file mode 100644 index 4543b06..0000000 --- a/consts/dict_file.go +++ /dev/null @@ -1,28 +0,0 @@ -package consts - -const ( - // dict file type to loading - - // LoadDictTypeIDF dict of IDF to loading - LoadDictTypeIDF = iota + 1 - - // LoadDictTypeTFIDF dict of TFIDF to loading - LoadDictTypeTFIDF - - // LoadDictTypeBM25 dict of BM25 to loading - LoadDictTypeBM25 - - // LoadDictTypeWithPos dict of with position to loading - LoadDictTypeWithPos - - // LoadDictCorpus dict of corpus to loading - LoadDictCorpus -) - -const ( - // BM25DefaultK1 default k1 value for calculate bm25 - BM25DefaultK1 = 1.25 - - // BM25DefaultK1 default B value for calculate bm25 - BM25DefaultB = 0.75 -) diff --git a/dict_1.16.go b/dict_1.16.go index 0b17a5c..d2dd33f 100644 --- a/dict_1.16.go +++ b/dict_1.16.go @@ -1,5 +1,6 @@ -// Copyright 2016 The go-ego Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at +// Copyright 2016 The go-ego Project Developers. +// +// See the COPYRIGHT file at the top-level directory of this distribution and at // https://github.com/go-ego/gse/blob/master/LICENSE // // Licensed under the Apache License, Version 2.0