SynonymMap model should take IEnumerable<string> for synonyms
See original GitHub issueThe generated model for SynonymMap
takes a single string
for synonyms, which the user would then have to pass with newlines embedded. This “magic formula” approach is something we try to avoid and just make it obvious and idiomatic. Guidelines recommend instead taking an IEnumerable<string>
for the parameter and perhaps define the property as an IList<string>
to allow adding to it. The de/serializer should handle splitting and joining with newlines accordingly.
/cc @brjohnstmsft
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
SynonymMap model should take IEnumerable<string> for ...
The generated model for SynonymMap takes a single string for synonyms, which the user would then have to pass with newlines embedded.
Read more >13 Synonyms & Antonyms for ROLE MODEL
synonyms for role model · example · exemplar · good example · hero · heroine · idol · mentor · superstar ...
Read more >134 Synonyms & Antonyms for MODEL
synonyms for model · exemplary · miniature · classic · classical · copy · dummy · facsimile · imitation ...
Read more >40 Synonyms & Antonyms for BASED ON
synonyms for based on · entrenched · fixed · established · firm · grounded · deep.
Read more >13 Synonyms & Antonyms for PERSON TO LOOK UP TO
synonyms for person to look up to · epitome · exemplar · good example · ideal · ideal beauty · model · nonpareil...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Talked with @Yahnoosh about this. Here’s the summary:
Stream
makes sense as a way to ingest synonym map files onCreate
/CreateOrUpdate
. However, the single-string property in theSynonymMap
object should also be an option, if for no other reasons that demos/samples and theGet
/List
APIs.Please let me know if you have any questions.
@heaths Having a constructor that takes a
Stream
orTextReader
makes sense. I think it’s a pretty safe assumption that it will always be text, soTextReader
is probably fine.Taking
format
as a parameter is problematic right now because there is only one allowable value (it should be an enum and not a string BTW). We hide it in Track 1 because it’s pointless for users to have to pass the same value all the time. If we can add it as an additional parameter (or constructor overload) later, IMO we can leave it out for now.I would actually question the value of the third constructor rather than the second. If the map isn’t coming from a file, it’s probably being pasted from somewhere else. Constructing it programmatically line-by-line is useful for samples, but that’s about it. CC @Yahnoosh who can back me up on this.