Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Added

- [SIL.LCModel] Add SpecificItemAndFieldName() to ISenseOrEntry
- [SIL.LCModel] Added a parameter to GetBestGuess() and TryGetBestGuess() to do lowercase matching regardless of the occurrence index
- [SIL.LCModel] Add GetCaptionOrHeadword() to CmPicture
- [SIL.LCModel] `LCModelStrings.NotSure` to allow clients to know if a grammatical category is the placeholder
Expand Down
26 changes: 26 additions & 0 deletions src/SIL.LCModel/DomainImpl/OverridesLing_Lex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10065,5 +10065,31 @@ public ILcmReferenceSequence<ICmPossibility> DialectLabelsRS
return sense.DialectLabelsSenseOrEntry;
}
}

/// <summary>
/// There are some special cases where the value of a field cannot be obtained
/// by getting the value of fieldName on the SenseOrEntry.Item. This method accounts for
/// those special cases and returns the Item and fieldName that will need to be used to
/// get the value. If it is not a special case then the default is to return SenseOrEntry.Item
/// for specificItem and return fieldName for specificFieldName.
/// </summary>
/// <param name="fieldName">The general fieldName associated with this SenseOrEntry object.</param>
/// <param name="specificItem">The specific LexSense or LexEntry item that will contain a
/// value for specificFieldName.</param>
/// <param name="specificFieldName">The specific field name that will need to be used to get
/// the value from the specificItem.</param>
public void SpecificItemAndFieldName(string fieldName, out ICmObject specificObject, out string specificFieldName)
{
specificObject = Item;
specificFieldName = fieldName;
if (fieldName == "HeadWordRef" && Item is ILexSense)
{
specificFieldName = "MLOwnerOutlineName";
}
else if (fieldName == "EntryRefsOS" && Item is ILexSense sense)
{
specificObject = sense.Entry;
}
}
}
}
14 changes: 14 additions & 0 deletions src/SIL.LCModel/InterfaceAdditions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5992,5 +5992,19 @@ public interface ISenseOrEntry
/// Returns the dialect labels for the entry or sense
/// </summary>
ILcmReferenceSequence<ICmPossibility> DialectLabelsRS { get; }

/// <summary>
/// There are some special cases where the value of a field cannot be obtained
/// by getting the value of fieldName on the SenseOrEntry.Item. This method accounts for
/// those special cases and returns the Item and fieldName that will need to be used to
/// get the value. If it is not a special case then the default is to return SenseOrEntry.Item
/// for specificItem and return fieldName for specificFieldName.
/// </summary>
/// <param name="fieldName">The general fieldName associated with this SenseOrEntry object.</param>
/// <param name="specificItem">The specific LexSense or LexEntry item that will contain a
/// value for specificFieldName.</param>
/// <param name="specificFieldName">The specific field name that will need to be used to get
/// the value from the specificItem.</param>
void SpecificItemAndFieldName(string fieldName, out ICmObject specificItem, out string specificFieldName);
}
}
Loading