/// <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;
/// <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;
/// <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;
/// <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;
/// <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;