BrazilCitiesFilter 1.0.2

dotnet add package BrazilCitiesFilter --version 1.0.2
                    
NuGet\Install-Package BrazilCitiesFilter -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BrazilCitiesFilter" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BrazilCitiesFilter" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="BrazilCitiesFilter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BrazilCitiesFilter --version 1.0.2
                    
#r "nuget: BrazilCitiesFilter, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=BrazilCitiesFilter&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=BrazilCitiesFilter&version=1.0.2
                    
Install as a Cake Tool

BrazilCitiesFilter

NuGet License

✨ Overview

BrazilCitiesFilter is a lightweight and fast library for searching and correcting Brazilian city names based on a preprocessed binary dictionary with normalized names. Perfect for data validation, autocomplete, or any scenario where users may input city names with typos, missing accents, or inconsistent casing.

📦 Installation

Install via NuGet Package Manager:

dotnet add package BrazilCitiesFilter

Or via Visual Studio ➔ Manage NuGet Packages ➔ Search for BrazilCitiesFilter.

🚀 Features

  • 🔍 Fast lookup of cities using normalized name comparison.
  • 🛠️ Automatic correction of misspelled or unformatted city names.
  • Optimized binary loading with MessagePack.
  • 📚 Full access to the list of loaded cities.

⚡ Quick Start

using BrazilCitiesFilter;

ISearch search = new Search();

// Get all cities matching the name (normalized)
var cities = search.GetCitiesByName("sao paulo");

// Get only the first matching city
var city = search.GetFirstCityByName("SÃO PAULO");

// Correct a misspelled or unformatted name
var correctedName = search.CorrectTheCityName("rio de janero");

Console.WriteLine(correctedName); // Rio de Janeiro

📄 API Overview

Method / Property Description
Cities Full list of all loaded cities.
GetCitiesByName(name) Returns all cities that match the provided name (normalized).
GetFirstCityByName(name) Returns the first city that matches the name.
CorrectTheCityName(name) Returns the correct name of a city, or the original name if not found.

📁 Requirements

  • A cities.bin file containing city data serialized with MessagePack.
  • .NET 6.0 or later.

📝 License

This project is licensed under the MIT License.

BrazilCitiesFilter — intelligent and performant city name matching.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 266 6/9/2025
1.0.1 258 6/9/2025
1.0.0 261 6/9/2025