/// <summary> /// 删除一个依赖关系。 /// </summary> /// <param name="dependency">要删除的依赖关系</param> public void RemoveDependency(Dependency dependency) { lock (_dependencies) { _dependencies.Remove(dependency); } }
/// <summary> /// 在分句内标注一个依赖关系。 /// </summary> /// <param name="dependency">要标注的依赖关系</param> public void AnnotateDependency(Dependency dependency) { lock (_dependencies) { if (dependency == null) return; int index = _dependencies.BinarySearch(dependency, s_dependencyComparer); if (index < 0) { dependency.Context = this; _dependencies.Insert(~index, dependency); } } }