Revamp questionnaire, parallelize run-all, add new tasks
- Replace 6 compound Likert questions with 12 atomic ones grouped by dimension (syntax, expressiveness, data/IO, errors, overall); drop free-form question. Responses now stored as ints, not strings. - Back-compat layer maps legacy keys to new dimensions so existing results still render. - Parallelize run-all with ThreadPoolExecutor (configurable workers) and add a thread-safe min-request-interval rate limiter to the Anthropic provider. - Add new tasks: path_normalizer, todo_manager, currency_converter, locale_weather_url, network_info_parser, url_normalizer.
This commit is contained in:
76
tasks/pipeline/locale_weather_url.toml
Normal file
76
tasks/pipeline/locale_weather_url.toml
Normal file
@@ -0,0 +1,76 @@
|
||||
name = "locale_weather_url"
|
||||
category = "pipeline"
|
||||
mode = "convert"
|
||||
description = """
|
||||
Construct weather API URLs from locale and location information.
|
||||
Read lines from stdin in the format: LANG_CODE LOCATION
|
||||
where LANG_CODE is a 2-letter locale (e.g., "en", "fr", "de")
|
||||
and LOCATION is a city/place name (may contain spaces).
|
||||
|
||||
For each line, construct a URL in the format:
|
||||
https://LANG.wttr.in/LOCATION
|
||||
|
||||
Where spaces in the location are replaced with "+" characters.
|
||||
|
||||
If LANG_CODE is empty or invalid (not exactly 2 lowercase letters),
|
||||
default to "en".
|
||||
|
||||
Skip empty lines. Output one URL per input line.
|
||||
"""
|
||||
|
||||
bash_source = '''
|
||||
#!/bin/bash
|
||||
while IFS= read -r line || [[ -n "$line" ]]; do
|
||||
[[ -z "$line" ]] && continue
|
||||
|
||||
# Extract lang code (first field)
|
||||
lang=$(echo "$line" | awk '{print $1}')
|
||||
|
||||
# Extract location (everything after first field)
|
||||
location=$(echo "$line" | sed 's/^[^ ]* *//')
|
||||
|
||||
# Validate lang code: must be exactly 2 lowercase letters
|
||||
if [[ ! "$lang" =~ ^[a-z]{2}$ ]]; then
|
||||
lang="en"
|
||||
fi
|
||||
|
||||
# If location is same as lang (single-word line), skip
|
||||
if [[ "$location" == "$lang" || -z "$location" ]]; then
|
||||
location=""
|
||||
fi
|
||||
|
||||
# Replace spaces with +
|
||||
location=$(echo "$location" | tr ' ' '+')
|
||||
|
||||
echo "https://$lang.wttr.in/$location"
|
||||
done
|
||||
'''
|
||||
|
||||
[[test_cases]]
|
||||
description = "Various locales and locations"
|
||||
stdin = """en New York
|
||||
fr Paris
|
||||
de Berlin
|
||||
ja Tokyo"""
|
||||
expected_stdout = """https://en.wttr.in/New+York
|
||||
https://fr.wttr.in/Paris
|
||||
https://de.wttr.in/Berlin
|
||||
https://ja.wttr.in/Tokyo"""
|
||||
|
||||
[[test_cases]]
|
||||
description = "Multi-word locations"
|
||||
stdin = """en San Francisco
|
||||
es Buenos Aires
|
||||
pt Rio de Janeiro"""
|
||||
expected_stdout = """https://en.wttr.in/San+Francisco
|
||||
https://es.wttr.in/Buenos+Aires
|
||||
https://pt.wttr.in/Rio+de+Janeiro"""
|
||||
|
||||
[[test_cases]]
|
||||
description = "Invalid or missing locale defaults to en"
|
||||
stdin = """ENG London
|
||||
123 Moscow
|
||||
x Rome"""
|
||||
expected_stdout = """https://en.wttr.in/London
|
||||
https://en.wttr.in/Moscow
|
||||
https://en.wttr.in/Rome"""
|
||||
Reference in New Issue
Block a user