parser

package
v0.0.0-...-c71366f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OCRImage

func OCRImage(img []byte) (string, error)

* OCRImage, passes the image contained in img to tesseract with "-l deu" and returns the text recognized by tesseract or an error

func PDFToPng

func PDFToPng(pdf []byte) ([]byte, error)

PDFToPng, uses "pdftoppm" to convert pdf to an img

func PDFToText

func PDFToText(pdf []byte) ([]byte, error)

func UKSHMenuToTiles

func UKSHMenuToTiles(imgBytes []byte) ([]imageContainer, error)

UKSHMenuToTiles, expects the bytes of png depicting the uksh menu plan and applies whaky 2D arithmetic to cut in into tiles containing the single dishes

Types

type Dish

type Dish struct {
	Title       string
	Description string
	Price       string
	Kcal        string
	Type        string
	Date        time.Time
	// contains filtered or unexported fields
}

func PDFToDishes

func PDFToDishes(pdf []byte) ([]*Dish, error)

mergeTextAndOCR, contains the information with textToDish with the price information from the OCR analysis

func PDFToDishesInYear

func PDFToDishesInYear(pdf []byte, year int) ([]*Dish, error)

mergeTextAndOCR, contains the information with textToDish with the price information from the OCR analysis

func TileToDish

func TileToDish(tile []byte) (*Dish, error)

func (Dish) String

func (d Dish) String() string

type UKSHParser

type UKSHParser struct{}

func (*UKSHParser) PDFToDishes

func (p *UKSHParser) PDFToDishes(pdf []byte) ([]*Dish, error)

type UKSHParserI

type UKSHParserI interface {
	PDFToDishes(pdf []byte) ([]*Dish, error)
}

Jump to

Keyboard shortcuts

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