github.com/geniusesgroup/libgo@v0.0.0-20220713101832-828057a9d3d4/matn/text-index-set_test.go (about)

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package matn
     4  
     5  import (
     6  	"fmt"
     7  	"testing"
     8  )
     9  
    10  func TestTextWordTokenization(t *testing.T) {
    11  	type args struct {
    12  		req *TextIndexSetReq
    13  	}
    14  	tests := []struct {
    15  		name string
    16  		args args
    17  	}{
    18  		{
    19  			name: "test1",
    20  			args: args{
    21  				req: &TextIndexSetReq{
    22  					Text: "test is best",
    23  				},
    24  			},
    25  		},
    26  		{
    27  			name: "test2",
    28  			args: args{
    29  				req: &TextIndexSetReq{
    30  					Text: "مجتمع سبز - گلستان شیراز",
    31  				},
    32  			},
    33  		},
    34  	}
    35  	for _, tt := range tests {
    36  		t.Run(tt.name, func(t *testing.T) {
    37  			fmt.Println("WordTokenization() for", tt.name)
    38  			indexes := WordTokenization(tt.args.req)
    39  			for _, index := range indexes {
    40  				fmt.Println(index.Word)
    41  			}
    42  		})
    43  	}
    44  }