utils

package
v0.0.0-...-7ca4f91 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateSimilarity

func CalculateSimilarity(s1, s2 string) float64

calculateSimilarity calculates a simple similarity score between two strings

func CleanExtractedValue

func CleanExtractedValue(value string) string

cleanExtractedValue removes common artifacts and validates the value

func ContainsMetadataField

func ContainsMetadataField(content string, indicators []string) bool

containsMetadataField checks if any of the field indicators are present in the content

func GenerateDescriptionFromModelName

func GenerateDescriptionFromModelName(modelName string) string

generateDescriptionFromModelName creates a readable description from a model name

func GenerateReadableDescription

func GenerateReadableDescription(modelName string) string

GenerateReadableDescription creates a human-readable description from a model name

func GetLicenseURL

func GetLicenseURL(licenseID string) string

getLicenseURL returns the canonical URL for well-known licenses

func IsValidValue

func IsValidValue(value string, minLength int, maxLength int, allowedPatterns []string) bool

isValidValue checks if a value meets basic quality criteria

func NormalizeModelName

func NormalizeModelName(name string) string

normalizeModelName normalizes model names for comparison

func NormalizeTask

func NormalizeTask(task string) string

NormalizeTask normalizes a task description to standard task categories

func ParseDateToEpoch

func ParseDateToEpoch(dateStr string) *int64

parseDateToEpoch converts a date string to Unix epoch timestamp

func ParseLanguageNames

func ParseLanguageNames(langStr string) []string

parseLanguageNames converts language names to locale codes

func ParseTimeToEpochInt64

func ParseTimeToEpochInt64(timeStr string) *int64

parseTimeToEpochInt64 converts ISO 8601 timestamp to epoch milliseconds int64

func SanitizeManifestRef

func SanitizeManifestRef(manifestRef string) string

sanitizeManifestRef creates a valid directory name from manifestRef

Types

This section is empty.

Jump to

Keyboard shortcuts

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