示例#1
0
 /// <summary>
 /// True if entity text completely includes another entity text.
 /// </summary>
 /// <param name="entity">Entity to compare.</param>
 /// <returns>True if entity text completely covers other entity text.</returns>
 public bool Covers(EntityInfo entity)
 => Start <= entity.Start && End >= entity.End && End - Start > entity.End - entity.Start;
示例#2
0
 /// <summary>
 /// True if entities come from exactly the same text in the utterance.
 /// </summary>
 /// <param name="entity">Entity to compare.</param>
 /// <returns>True if entities are from the same text.</returns>
 public bool Alternative(EntityInfo entity)
 => Start == entity.Start && End == entity.End;
示例#3
0
 /// <summary>
 /// True if entity text completely includes another entity text.
 /// </summary>
 /// <param name="entity">Entity to compare.</param>
 /// <returns>True if entity text completely covers other entity text.</returns>
 public bool Covers(EntityInfo entity)
 => (entity == this || entity.RootEntity != RootEntity) && Start <= entity.Start && End >= entity.End && End - Start > entity.End - entity.Start;
示例#4
0
 /// <summary>
 /// True if entities share text in utterance.
 /// </summary>
 /// <param name="entity">Entity to compare.</param>
 /// <returns>True if entities overlap.</returns>
 public bool Overlaps(EntityInfo entity)
 => Start <= entity.End && End >= entity.Start;
示例#5
0
 /// <summary>
 /// True if entities share text in utterance.
 /// </summary>
 /// <param name="entity">Entity to compare.</param>
 /// <returns>True if entities overlap.</returns>
 public bool Overlaps(EntityInfo entity)
 => (entity == this || entity.RootEntity != RootEntity) && Start <= entity.End && End >= entity.Start;