| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="InflectionRules.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | using System.Collections.Immutable; |
| | | 8 | | |
| | | 9 | | namespace MyNet.Globalization.Inflection; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Represents a collection of inflection rules, including pluralization rules, singularization rules, and uncountable w |
| | | 13 | | /// </summary> |
| | | 14 | | public sealed class InflectionRules |
| | | 15 | | { |
| | | 16 | | /// <summary> |
| | | 17 | | /// Gets an empty instance of <see cref="InflectionRules"/> with no pluralization rules, singularization rules, or u |
| | | 18 | | /// </summary> |
| | 0 | 19 | | public static InflectionRules Empty { get; } = new() |
| | 0 | 20 | | { |
| | 0 | 21 | | Plurals = [], |
| | 0 | 22 | | Singulars = [], |
| | 0 | 23 | | Uncountables = [] |
| | 0 | 24 | | }; |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// Gets the collection of pluralization rules, which define how to transform singular words into their plural forms |
| | | 28 | | /// </summary> |
| | | 29 | | public required ImmutableArray<InflectionRule> Plurals { get; init; } |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// Gets the collection of singularization rules, which define how to transform plural words into their singular for |
| | | 33 | | /// </summary> |
| | | 34 | | public required ImmutableArray<InflectionRule> Singulars { get; init; } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Gets the collection of uncountable words, which are words that do not have a distinct plural form. |
| | | 38 | | /// </summary> |
| | | 39 | | public required ImmutableHashSet<string> Uncountables { get; init; } |
| | | 40 | | } |
| | | 41 | | |