<commit_before>package mensa

import (
	"fmt"
	"strings"
)

// LocationValid checks whether string id is a valid STWM canteen ID
func LocationValid(id string) bool {
	var mensen = map[string]string{
		"411": "<NAME>",
		"412": "<NAME>",
		"421": "<NAME>",
		"422": "<NAME>",
		"423": "<NAME>",
		"431": "<NAME>",
		"432": "<NAME>",
	}
	var valid bool
	_, valid = mensen[id]
	return valid
}

// FormatValid checks, whether the string format is either "xml" or "lis",
// which are the two supported output formats
func FormatValid(format string) bool {
	return format == "xml" || format == "lis"
}

/*
ParseArgs checks if the command line arguments are valid.
The input osargs is supposed to be the output of os.Args

Known arguments are:
	-h --help: Print this usage info and quit
	-o --output: set the path to the output file (mandatory)
	-l --location: set mensa location id (default: 421)
	-f --format: select format (default: xml)

If -h or --help is detected, a help message is printed to stdout.

If the parsed command line aguments are either not valid or contained the
-h/--help switch, a non-nil error is returned and the returned arguments
Args do not contain valid command line arguments.
*/
func ParseArgs(osargs []string) (Args, error) {
	// initialize internal arguents with empty strings
	var r Args
	r.Location = ""
	r.Outfile = ""
	r.Format = ""

	i := 1
	for i < len(osargs) {
		switch {<commit_msg>Adapted documentation to previous change<commit_after>package mensa

import (
	"fmt"
	"strings"
)

// LocationValid checks whether string id is a valid STWM canteen ID
func LocationValid(id string) bool {
	var mensen = map[string]string{
		"411": "<NAME>",
		"412": "<NAME>",
		"421": "<NAME>",
		"422": "<NAME>",
		"423": "<NAME>",
		"431": "<NAME>",
		"432": "<NAME>",
	}
	var valid bool
	_, valid = mensen[id]
	return valid
}

// FormatValid checks, whether the string format is either "xml" or "lis",
// which are the two supported output formats
func FormatValid(format string) bool {
	return format == "xml" || format == "lis"
}

/*
ParseArgs checks if the command line arguments are valid.
The input osargs is supposed to be the output of os.Args

Known arguments are:
	-h --help: Print this usage info and quit
	-o --output: set the path to the output file (mandatory)
	-l --location: set mensa location id (default: 421)
	-f --format: select format (default: xml)

If -h or --help is detected a "help" error is returned.
If the parsed command line aguments are not valid an other non-nil error
is returned. In both cases the returned arguments Args do not contain valid
 command line arguments.
*/
func ParseArgs(osargs []string) (Args, error) {
	// initialize internal arguents with empty strings
	var r Args
	r.Location = ""
	r.Outfile = ""
	r.Format = ""

	i := 1
	for i < len(osargs) {
		switch {
{'fraction_non_alphanumeric': 0.12353982300884955, 'fraction_numerical': 0.017699115044247787, 'mean_word_length': 3.6865671641791047, 'pattern_counts': {'":': 14, '<': 19, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7105613', 'n_tokens_mistral': 937, 'n_tokens_neox': 879, 'n_words': 387}