add tesseract support

This commit is contained in:
2023-07-03 17:46:58 +05:30
parent feb3baef9e
commit f89cf56d86
5 changed files with 47 additions and 1 deletions

View File

@@ -3,7 +3,6 @@ package utils
import (
"github.com/gocolly/colly"
"os"
"strings"
)
func TranslateGoogle(to string, from string, query string) string {

13
utils/imgtxt.go Normal file
View File

@@ -0,0 +1,13 @@
package utils
import (
"github.com/otiai10/gosseract/v2"
)
func ImgTxt(file string) string {
client := gosseract.NewClient()
defer client.Close()
client.SetImage(file)
text, _ := client.Text()
return text
}