Ejemplo n.º 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Begin != 0)
            {
                hash ^= Begin.GetHashCode();
            }
            if (End != 0)
            {
                hash ^= End.GetHashCode();
            }
            if (Text.Length != 0)
            {
                hash ^= Text.GetHashCode();
            }
            if (conceptInfoCase_ == ConceptInfoOneofCase.DBpediaInfo)
            {
                hash ^= DBpediaInfo.GetHashCode();
            }
            if (conceptInfoCase_ == ConceptInfoOneofCase.BabelNetInfo)
            {
                hash ^= BabelNetInfo.GetHashCode();
            }
            if (conceptInfoCase_ == ConceptInfoOneofCase.NerInfo)
            {
                hash ^= NerInfo.GetHashCode();
            }
            hash ^= (int)conceptInfoCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 2
0
        public void MergeFrom(Concept other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Begin != 0)
            {
                Begin = other.Begin;
            }
            if (other.End != 0)
            {
                End = other.End;
            }
            if (other.Text.Length != 0)
            {
                Text = other.Text;
            }
            switch (other.ConceptInfoCase)
            {
            case ConceptInfoOneofCase.DBpediaInfo:
                if (DBpediaInfo == null)
                {
                    DBpediaInfo = new global::V4Design.Protos.Taln.DBpediaConceptInfo();
                }
                DBpediaInfo.MergeFrom(other.DBpediaInfo);
                break;

            case ConceptInfoOneofCase.BabelNetInfo:
                if (BabelNetInfo == null)
                {
                    BabelNetInfo = new global::V4Design.Protos.Taln.BabelNetConceptInfo();
                }
                BabelNetInfo.MergeFrom(other.BabelNetInfo);
                break;

            case ConceptInfoOneofCase.NerInfo:
                if (NerInfo == null)
                {
                    NerInfo = new global::V4Design.Protos.Taln.NerConceptInfo();
                }
                NerInfo.MergeFrom(other.NerInfo);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }