Small fixes

This commit is contained in:
Andras Schmelczer 2026-06-14 14:52:44 +01:00
parent 54fbcb1ea6
commit 083f8a982e
24 changed files with 1505 additions and 79 deletions

View file

@ -6,6 +6,29 @@ mod postcodes;
mod property;
pub mod travel_time;
/// Apostrophe-like code points that should be elided (not treated as word breaks) when
/// normalizing search text. Keyboards, autocorrect and copy-paste all produce different glyphs
/// for what users mean as an apostrophe; treating any of them as a separator turns "King's Cross"
/// into the tokens `king s cross` and breaks matching. Covers the straight ASCII apostrophe, the
/// typographic left/right single quotes, grave/acute accents, the modifier-letter apostrophes,
/// prime, and the fullwidth apostrophe.
pub(crate) fn is_apostrophe(ch: char) -> bool {
matches!(
ch,
'\u{0027}' // ' APOSTROPHE
| '\u{0060}' // ` GRAVE ACCENT
| '\u{00B4}' // ´ ACUTE ACCENT
| '\u{02B9}' // ʹ MODIFIER LETTER PRIME
| '\u{02BB}' // ʻ MODIFIER LETTER TURNED COMMA (ʻokina)
| '\u{02BC}' // ʼ MODIFIER LETTER APOSTROPHE
| '\u{2018}' // ' LEFT SINGLE QUOTATION MARK
| '\u{2019}' // ' RIGHT SINGLE QUOTATION MARK
| '\u{201B}' // SINGLE HIGH-REVERSED-9 QUOTATION MARK
| '\u{2032}' // PRIME
| '\u{FF07}' // FULLWIDTH APOSTROPHE
)
}
fn panic_payload_message(payload: &(dyn std::any::Any + Send)) -> String {
if let Some(message) = payload.downcast_ref::<&'static str>() {
(*message).to_string()