github.com/GeniusesGroup/libgo@v0.0.0-20220929090155-5ff932cb408e/matn/text-index-get.go (about)

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package matn
     4  
     5  import (
     6  	er "../error"
     7  )
     8  
     9  // IndexTextGetReq is request structure of IndexTextGet()
    10  type IndexTextGetReq struct {
    11  	Terms      []string
    12  	PageNumber uint64
    13  }
    14  
    15  // IndexTextGetRes is response structure of IndexTextGet()
    16  type IndexTextGetRes struct {
    17  	Tokens [10]PhraseToken
    18  }
    19  
    20  // IndexTextGet return index data of given terms if any exist
    21  func IndexTextGet(req *IndexTextGetReq) (res *IndexTextGetRes, err protocol.Error) {
    22  
    23  	res = &IndexTextGetRes{}
    24  
    25  	return
    26  }
    27  
    28  // PhraseTokenization uses the delimiters categorized under [Dash, Hyphen, Pattern_Syntax, Quotation_Mark, Terminal_Punctuation, White_Space]
    29  // drop language-specific stop words (e.g. in English, the, an, a, and, etc.)
    30  func PhraseTokenization(text string) (tokenized []string) {
    31  	return
    32  }