Fmt
This commit is contained in:
parent
083f8a982e
commit
e90a3285a1
6 changed files with 25 additions and 32 deletions
|
|
@ -194,9 +194,7 @@ export function useTravelTime(initial?: TravelTimeInitial) {
|
|||
setEntries((prev) =>
|
||||
dedupeTravelTimeEntries(
|
||||
prev.map((entry, i) =>
|
||||
i === index
|
||||
? { ...entry, noChange: !(entry.noChange ?? false), oneChange: false }
|
||||
: entry
|
||||
i === index ? { ...entry, noChange: !(entry.noChange ?? false), oneChange: false } : entry
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -897,7 +897,7 @@ const fr: Translations = {
|
|||
walk: 'Marche',
|
||||
cycle: 'Vélo',
|
||||
nationalAvg: 'Moyenne nationale',
|
||||
crimeDataEnds: 'Les données de police pour cette zone s\'arrêtent en {{year}}',
|
||||
crimeDataEnds: "Les données de police pour cette zone s'arrêtent en {{year}}",
|
||||
},
|
||||
|
||||
// ── Street View ────────────────────────────────────
|
||||
|
|
|
|||
|
|
@ -776,14 +776,14 @@ mod tests {
|
|||
// and matching breaks. See is_apostrophe for the full set.
|
||||
let expected = "kings cross";
|
||||
for q in [
|
||||
"King's Cross", // U+0027 straight
|
||||
"King’s Cross", // U+2019 right single quote
|
||||
"King‘s Cross", // U+2018 left single quote
|
||||
"King´s Cross", // U+00B4 acute accent
|
||||
"Kingʼs Cross", // U+02BC modifier letter apostrophe
|
||||
"King′s Cross", // U+2032 prime
|
||||
"King`s Cross", // U+0060 grave accent
|
||||
"Kingʻs Cross", // U+02BB modifier letter turned comma
|
||||
"King's Cross", // U+0027 straight
|
||||
"King’s Cross", // U+2019 right single quote
|
||||
"King‘s Cross", // U+2018 left single quote
|
||||
"King´s Cross", // U+00B4 acute accent
|
||||
"Kingʼs Cross", // U+02BC modifier letter apostrophe
|
||||
"King′s Cross", // U+2032 prime
|
||||
"King`s Cross", // U+0060 grave accent
|
||||
"Kingʻs Cross", // U+02BB modifier letter turned comma
|
||||
] {
|
||||
assert_eq!(normalize_search_text(q), expected, "failed for {q:?}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -791,12 +791,12 @@ mod tests {
|
|||
// tokenizes differently depending on which quote glyph was typed.
|
||||
let expected = vec!["obrien".to_string(), "road".to_string()];
|
||||
for addr in [
|
||||
"O'Brien Road", // U+0027 straight
|
||||
"O’Brien Road", // U+2019 right single quote
|
||||
"O‘Brien Road", // U+2018 left single quote
|
||||
"O´Brien Road", // U+00B4 acute accent
|
||||
"OʼBrien Road", // U+02BC modifier letter apostrophe
|
||||
"O′Brien Road", // U+2032 prime
|
||||
"O'Brien Road", // U+0027 straight
|
||||
"O’Brien Road", // U+2019 right single quote
|
||||
"O‘Brien Road", // U+2018 left single quote
|
||||
"O´Brien Road", // U+00B4 acute accent
|
||||
"OʼBrien Road", // U+02BC modifier letter apostrophe
|
||||
"O′Brien Road", // U+2032 prime
|
||||
] {
|
||||
assert_eq!(tokenize_address_text(addr), expected, "failed for {addr:?}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1155,14 +1155,14 @@ mod tests {
|
|||
// step == 1.0 but wide-range (would explode bin count) or fractional
|
||||
// (averages/percentiles) features must keep percentile binning.
|
||||
for name in [
|
||||
"Construction year", // Fixed but spans ~2000 years
|
||||
"Date of last transaction", // Fixed, fractional years
|
||||
"Income Score", // 0..100 percentile
|
||||
"% White", // 0..100 percentage
|
||||
"Noise (dB)", // 50..80, range > threshold
|
||||
"Serious crime (avg/yr)", // Percentile bounds, fractional
|
||||
"Interior height (m)", // step 0.1
|
||||
"Estimated current price", // step 10000
|
||||
"Construction year", // Fixed but spans ~2000 years
|
||||
"Date of last transaction", // Fixed, fractional years
|
||||
"Income Score", // 0..100 percentile
|
||||
"% White", // 0..100 percentage
|
||||
"Noise (dB)", // 50..80, range > threshold
|
||||
"Serious crime (avg/yr)", // Percentile bounds, fractional
|
||||
"Interior height (m)", // step 0.1
|
||||
"Estimated current price", // step 10000
|
||||
] {
|
||||
assert!(
|
||||
!has_integer_bins(name),
|
||||
|
|
|
|||
|
|
@ -368,12 +368,7 @@ pub fn compute_crime_by_year(
|
|||
/// force-level publication gaps (e.g. Greater Manchester ends mid-2019) as
|
||||
/// stale data instead of letting old numbers read as current.
|
||||
pub fn crime_latest_available_year(crime_by_year: &CrimeByYearData) -> Option<i32> {
|
||||
crime_by_year
|
||||
.years_by_type
|
||||
.iter()
|
||||
.flatten()
|
||||
.copied()
|
||||
.max()
|
||||
crime_by_year.years_by_type.iter().flatten().copied().max()
|
||||
}
|
||||
|
||||
pub fn compute_poi_feature_stats(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue