import Data.Text (Text)
import Gargantext.Prelude
-import Gargantext.Text.Ngrams
-import Gargantext.Text.Ngrams.Stem as ST
+import Gargantext.Text.Terms.Mono (monoTexts)
+import Gargantext.Text.Terms.Mono.Stem as ST
import Gargantext.Text.Parsers.CSV
type DocId = Int
type DocSearchEngine = SearchEngine
- Doc
+ CsvGargV3
DocId
DocField
NoFeatures
initialDocSearchEngine =
initSearchEngine docSearchConfig defaultSearchRankParameters
-docSearchConfig :: SearchConfig Doc DocId DocField NoFeatures
+docSearchConfig :: SearchConfig CsvGargV3 DocId DocField NoFeatures
docSearchConfig =
SearchConfig {
documentKey = d_docId,
- extractDocumentTerms = extractTokens,
+ extractDocumentTerms = extractTerms,
transformQueryTerm = normaliseQueryToken,
documentFeatureValue = const noFeatures
}
where
- extractTokens :: Doc -> DocField -> [Text]
- extractTokens doc TitleField = monograms (d_title doc)
- extractTokens doc AbstractField = monograms (d_abstract doc)
+ extractTerms :: CsvGargV3 -> DocField -> [Text]
+ extractTerms doc TitleField = monoTexts (d_title doc)
+ extractTerms doc AbstractField = monoTexts (d_abstract doc)
normaliseQueryToken :: Text -> DocField -> Text
normaliseQueryToken tok =