keyword

package
v1.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

README

ULIB Keyword

Fast wrapper for keyword lookup.

Example: Github

Regexp

Normal

package main

import (
	"fmt"

	"github.com/3JoB/ulib/keyword"
)

func main() {
	text := "hello world"
	kw := "world"
	fmt.Printf("RegexpFind: %v\n", keyword.RegexpFind(text, kw))
}

Compile:

package main

import (
    "fmt"

    "github.com/3JoB/ulib/keyword"
)

func main(){
    text := "hello world"
    text2 := "hello golang"
	kw := "world"
    re, _ := keyword.RegexpCompile(kw)
	reb, _ := re.Find(text)
	fmt.Printf("RegexpFind: %v\n", reb)
    reb2, _ := re.Find(text2)
	fmt.Printf("RegexpFind 2: %v\n", reb2)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoyerMooreCompile

func BoyerMooreCompile(keyword string) (*bms.BMSCompile, error)

Use Boyer-Moore's compilation method to find the existence of keywords

func BoyerMooreFind

func BoyerMooreFind(text, keyword string) bool

Use the Boyer-Moore method to find the existence of keywords.

func FlashNewPool

func FlashNewPool(keyword ...string) *flash.Flash

Use Flash's compilation method to find out whether keywords exist.

func FlashSearch

func FlashSearch(text string, keyword ...string) bool

Use the Flash method to find whether the keyword exists.

func RegexpCompile

func RegexpCompile(keyword string) (*regexp.KeywordCompile, error)

Use the compilation method of regexp to find whether the keyword exists.

func RegexpFind

func RegexpFind(text, keyword string) bool

Use the regexp method to find whether a keyword exists.

Types

This section is empty.

Directories

Path Synopsis
This is not a public method package, it is recommended to use an external wrapper.
This is not a public method package, it is recommended to use an external wrapper.
This is not a public method package, it is recommended to use an external wrapper.
This is not a public method package, it is recommended to use an external wrapper.
This is not a public method package, it is recommended to use an external wrapper.
This is not a public method package, it is recommended to use an external wrapper.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL