public OpinionMiningTuple(SubjectEssence subject, ObjectEssence @object, XElement sentence , int sentenceNumber, FilterBySynonyms filterBySynonyms, ICoreferenceInfo coreferenceInfo) { var tempSentence = Initialize(subject, sentence, sentenceNumber, filterBySynonyms, coreferenceInfo); @object.ThrowIfNull("object"); #region [.coreference-info.] var tuple = coreferenceInfo.TryGetMaster(@object.Entity); #endregion #region [.Find Object-entity & mark him as-inquiry.] var objectEntityInCopy = tempSentence.DescendantsAndSelf().FirstOrDefault(d => ObjectEntityEqualityComparer.Instance.Equals(d, @object.AnaphoriaAndEntityTuple.Entity)); if (objectEntityInCopy == null) { throw (new ArgumentException("Object-Entity not found in his Sentence. " + ("object.Entity: " + @object.AnaphoriaAndEntityTuple.Entity.ToString().InSingleQuote() + ", sentence: " + sentence.ToString().InSingleQuote()).InBrackets())); } objectEntityInCopy.MarkAsInquiry(); var objectAnaphoriaInCopy = default(XElement); if (@object.AnaphoriaAndEntityTuple.Anaphoria != null) { objectAnaphoriaInCopy = tempSentence.DescendantsAndSelf().FirstOrDefault(d => ObjectEntityEqualityComparer.Instance.Equals(d, @object.AnaphoriaAndEntityTuple.Anaphoria)); if (objectAnaphoriaInCopy == null) { throw (new ArgumentException("Object-Anaphoria-Entity not found in his Sentence. " + ("object.Entity: " + @object.AnaphoriaAndEntityTuple.Anaphoria.ToString().InSingleQuote() + ", sentence: " + sentence.ToString().InSingleQuote()).InBrackets())); } } @object = new ObjectEssence(new SubjectAndAnaphoriaEntityTuple(objectEntityInCopy, objectAnaphoriaInCopy), @object.IsSubjectIndeed); SentenceText = tempSentence.ToString(); tempSentence = null; #endregion Object = @object; #region [.coreference-info.] Object.TrySetValueWithCoreferenceInfo(tuple); #endregion }
public static OpinionMiningTuple Create4AuthorSubject(ObjectEssence @object, XElement sentence , int sentenceNumber, FilterBySynonyms filterBySynonyms, ICoreferenceInfo coreferenceInfo) { return(new OpinionMiningTuple(SubjectEssence.Author, @object, sentence , sentenceNumber, filterBySynonyms, coreferenceInfo)); }