From a02e4d5452db7509670e3421bcbba48d2d8ceedf Mon Sep 17 00:00:00 2001 From: "Quentin Dauprat, PhD" Date: Mon, 1 Dec 2025 12:08:29 +0100 Subject: [PATCH] distance 0.1.0 (via `alr publish`) (#1691) --- index/di/distance/distance-0.1.0.toml | 64 +++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 index/di/distance/distance-0.1.0.toml diff --git a/index/di/distance/distance-0.1.0.toml b/index/di/distance/distance-0.1.0.toml new file mode 100644 index 00000000..218e9295 --- /dev/null +++ b/index/di/distance/distance-0.1.0.toml @@ -0,0 +1,64 @@ +name = "distance" +description = "A formally verified library for calculating numeric, text distances" +version = "0.1.0" + +authors = ["Heziode"] +maintainers = ["Heziode "] +maintainers-logins = ["heziode"] +licenses = "Apache-2.0 WITH LLVM-exception" +website = "" +tags = ["ada", "spark", "distance", "metrics", "algorithms", "mathematics", "string", "similarity", "levenshtein", "geospatial", "high-integrity", "alire", "data-science"] + +long-description = """ +# Distance + +A formally verified Ada/SPARK library for computing distance and similarity metrics. + +## Features + +- **Numeric Distances**: Euclidean, Manhattan, Minkowski, Chebyshev, Canberra +- **Statistical Measures**: Cosine Similarity +- **Text Distances**: Levenshtein, Damerau-Levenshtein, Hamming, Jaro-Winkler, Sørensen-Dice + +## Highlights + +- Pure Ada 2012 with SPARK annotations +- Generic implementations for flexible type support +- No external dependencies (test suite uses AUnit) +- Comprehensive preconditions and postconditions + +## Usage + +```ada +with Ada.Numerics.Elementary_Functions; +with Distance.Numeric.Signatures; +with Distance.Numeric.Euclidean_Generic; + +procedure Example is + type Float_Vector is array (Positive range <>) of Float; + + package Float_Math is new Ada.Numerics.Elementary_Functions (Float); + package Float_Sig is new Distance.Numeric.Signatures + (Element_Type => Float, + Zero => 0.0, + One => 1.0, + Sqrt => Float_Math.Sqrt, + "**" => Float_Math."**", + Max_Element => Float'Last); + + function Euclidean is new Distance.Numeric.Euclidean_Generic + (Numeric_Ops => Float_Sig, Index_Type => Positive, Vector => Float_Vector); + + D : Float := Euclidean ((0.0, 0.0), (3.0, 4.0)); -- D = 5.0 +begin + null; +end Example; +``` + +For fixed-point and integer types, you can use [Spark_Math](https://github.com/adarium-labs/spark_math) to provide the required operations. +""" + +[origin] +commit = "e265e32656db1284ef750cbd473db95424e5b215" +url = "git+https://github.com/adarium-labs/distance.git" +