diff --git a/README.md b/README.md index c058854..d75338f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,6 @@ Just `go build` and you're done :D ## Features - An all mode where the responses of all supported engines will be shown. - Autodetect which will show the language that was detected -- Tesseract based image recognition (it isn't that good to be fair but it works nontheless) - Text-To-Speech for multiple engines - A good API (subjective :P) - All the stuff you expect from a translation utility :) diff --git a/cmd/imgtxt.go b/cmd/imgtxt.go deleted file mode 100644 index 346e0db..0000000 --- a/cmd/imgtxt.go +++ /dev/null @@ -1,33 +0,0 @@ -package cmd - -import ( - "fmt" - - "codeberg.org/aryak/mozhi/utils" - - "github.com/spf13/cobra" -) - -var file string - -var imgtxtCmd = &cobra.Command{ - Use: "imgtxt", - Short: "Image -> Text.", - Long: `Convert given image (filename) to text using gosseract.`, - Run: func(cmd *cobra.Command, args []string) { - text, err := utils.ImgTxt(file) - if err != nil { - fmt.Println("Failed to convert image to text: ", err) - } else { - fmt.Println(text) - } - }, -} - -func init() { - rootCmd.AddCommand(imgtxtCmd) - - imgtxtCmd.Flags().StringVarP(&file, "file", "f", "", "The query Mozhi will listen to. Defaults to 3000, and overrides the MOZHI_query environment variable.") - - langlist = imgtxtCmd.Flag("file").Value.String() -} diff --git a/utils/imgtxt.go b/utils/imgtxt.go deleted file mode 100644 index bbbfb7e..0000000 --- a/utils/imgtxt.go +++ /dev/null @@ -1,13 +0,0 @@ -package utils - -import ( - "github.com/otiai10/gosseract/v2" -) - -func ImgTxt(file string) (string, error) { - client := gosseract.NewClient() - defer client.Close() - client.SetImage(file) - text, err := client.Text() - return text, err -}