parser

package
v2.6.7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidCoordinates

func IsValidCoordinates(coordinates string) bool

IsValidCoordinates checks if a string contains a valid longitude or latitude.

Reference: https://stackoverflow.com/a/18690202/10067850

func ParseCoordinates

func ParseCoordinates(inputUrl string) (string, string)

ParseCoordinates extracts and parses longitude and latitude from a Google Maps URL.

Example inputUrl: "https://www.google.com/maps/embed/v1/place?key=AIzaSyDvEyVCVpGtn81z5NrMKgdehPsrO9sJiMw&q=45.1712728,10.3565788&language=en-US"

func ParseDistinction added in v2.1.0

func ParseDistinction(distinction string) string

ParseDistinction parses the Michelin distinction based on the input string.

func ParseGreenStar added in v2.3.2

func ParseGreenStar(distinction string) bool

ParseGreenStar parses the MICHELIN Green Star based on the input string.

func ParsePhoneNumber

func ParsePhoneNumber(inputPhoneNumber string) string

ParsePhoneNumber extracts and parses phone number from a raw string.

Example inputPhoneNumber: "+81 3-3874-1552"

func ParsePrice

func ParsePrice(inputPrice string) (string, string, string)

ParsePrice extracts and parses minPrice, maxPrice, and currency from a raw price string.

Example inputPrice: "148-248 USD", "1,000-1,280 CNY"

func SplitUnpack

func SplitUnpack(str string, separator string) (string, string)

SplitUnpack performs SplitN and unpacks a string.

func TrimWhiteSpaces

func TrimWhiteSpaces(str string) string

TrimWhiteSpaces trims whitespace character such as line breaks or double spaces.

Types

This section is empty.

Jump to

Keyboard shortcuts

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