@@ -9,13 +9,13 @@ namespace ManagedCode.Presidio.Analyzer;
99/// </summary>
1010public sealed class NlpEngineConfiguration
1111{
12- [ YamlMember ( Alias = "nlp_engine_name" ) ]
12+ [ YamlMember ( Alias = "nlp_engine_name" , ApplyNamingConventions = false ) ]
1313 public string EngineName { get ; init ; } = string . Empty ;
1414
15- [ YamlMember ( Alias = "models" ) ]
16- public IReadOnlyList < NlpModelConfiguration > Models { get ; init ; } = Array . Empty < NlpModelConfiguration > ( ) ;
15+ [ YamlMember ( Alias = "models" , ApplyNamingConventions = false ) ]
16+ public List < NlpModelConfiguration > Models { get ; init ; } = new ( ) ;
1717
18- [ YamlMember ( Alias = "ner_model_configuration" ) ]
18+ [ YamlMember ( Alias = "ner_model_configuration" , ApplyNamingConventions = false ) ]
1919 public NerModelConfiguration ? NerModelConfiguration { get ; init ; }
2020
2121 [ YamlIgnore ]
@@ -25,7 +25,7 @@ public NlpEngineConfiguration WithBaseDirectory(string? baseDirectory) =>
2525 new ( )
2626 {
2727 EngineName = EngineName ,
28- Models = Models ,
28+ Models = new List < NlpModelConfiguration > ( Models ) ,
2929 NerModelConfiguration = NerModelConfiguration ,
3030 BaseDirectory = baseDirectory ,
3131 } ;
@@ -36,25 +36,25 @@ public NlpEngineConfiguration WithBaseDirectory(string? baseDirectory) =>
3636/// </summary>
3737public sealed class NlpModelConfiguration
3838{
39- [ YamlMember ( Alias = "lang_code" ) ]
39+ [ YamlMember ( Alias = "lang_code" , ApplyNamingConventions = false ) ]
4040 public string LanguageCode { get ; init ; } = string . Empty ;
4141
42- [ YamlMember ( Alias = "model_name" ) ]
42+ [ YamlMember ( Alias = "model_name" , ApplyNamingConventions = false ) ]
4343 public string ? ModelName { get ; init ; }
4444
45- [ YamlMember ( Alias = "model_path" ) ]
45+ [ YamlMember ( Alias = "model_path" , ApplyNamingConventions = false ) ]
4646 public string ? ModelPath { get ; init ; }
4747
48- [ YamlMember ( Alias = "vocabulary_path" ) ]
48+ [ YamlMember ( Alias = "vocabulary_path" , ApplyNamingConventions = false ) ]
4949 public string ? VocabularyPath { get ; init ; }
5050
51- [ YamlMember ( Alias = "configuration_path" ) ]
51+ [ YamlMember ( Alias = "configuration_path" , ApplyNamingConventions = false ) ]
5252 public string ? ConfigurationPath { get ; init ; }
5353
54- [ YamlMember ( Alias = "metadata" ) ]
54+ [ YamlMember ( Alias = "metadata" , ApplyNamingConventions = false ) ]
5555 public IReadOnlyDictionary < string , string > ? Metadata { get ; init ; }
5656
57- [ YamlMember ( Alias = "max_sequence_length" ) ]
57+ [ YamlMember ( Alias = "max_sequence_length" , ApplyNamingConventions = false ) ]
5858 public int ? MaxSequenceLength { get ; init ; }
5959}
6060
@@ -63,17 +63,17 @@ public sealed class NlpModelConfiguration
6363/// </summary>
6464public sealed class NerModelConfiguration
6565{
66- [ YamlMember ( Alias = "model_to_presidio_entity_mapping" ) ]
66+ [ YamlMember ( Alias = "model_to_presidio_entity_mapping" , ApplyNamingConventions = false ) ]
6767 public IReadOnlyDictionary < string , string > ModelToPresidioEntityMapping { get ; init ; } =
6868 new ReadOnlyDictionary < string , string > ( new Dictionary < string , string > ( ) ) ;
6969
70- [ YamlMember ( Alias = "low_confidence_score_multiplier" ) ]
70+ [ YamlMember ( Alias = "low_confidence_score_multiplier" , ApplyNamingConventions = false ) ]
7171 public double ? LowConfidenceScoreMultiplier { get ; init ; }
7272
73- [ YamlMember ( Alias = "low_score_entity_names" ) ]
73+ [ YamlMember ( Alias = "low_score_entity_names" , ApplyNamingConventions = false ) ]
7474 public IReadOnlyList < string > LowScoreEntityNames { get ; init ; } = Array . Empty < string > ( ) ;
7575
76- [ YamlMember ( Alias = "labels_to_ignore" ) ]
76+ [ YamlMember ( Alias = "labels_to_ignore" , ApplyNamingConventions = false ) ]
7777 public IReadOnlyList < string > LabelsToIgnore { get ; init ; } = Array . Empty < string > ( ) ;
7878}
7979
0 commit comments