// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: Document.proto

package cc.factorie.protobuf;

public final class DocumentProtos {
  private DocumentProtos() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
  }
  public static final class Document extends
      com.google.protobuf.GeneratedMessage {
    // Use Document.newBuilder() to construct.
    private Document() {
      initFields();
    }
    private Document(boolean noInit) {}
    
    private static final Document defaultInstance;
    public static Document getDefaultInstance() {
      return defaultInstance;
    }
    
    public Document getDefaultInstanceForType() {
      return defaultInstance;
    }
    
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Document_descriptor;
    }
    
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Document_fieldAccessorTable;
    }
    
    public static final class Sentence extends
        com.google.protobuf.GeneratedMessage {
      // Use Sentence.newBuilder() to construct.
      private Sentence() {
        initFields();
      }
      private Sentence(boolean noInit) {}
      
      private static final Sentence defaultInstance;
      public static Sentence getDefaultInstance() {
        return defaultInstance;
      }
      
      public Sentence getDefaultInstanceForType() {
        return defaultInstance;
      }
      
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Document_Sentence_descriptor;
      }
      
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Document_Sentence_fieldAccessorTable;
      }
      
      // repeated .distant.protobuf.Document.Token tokens = 1;
      public static final int TOKENS_FIELD_NUMBER = 1;
      private java.util.List<cc.factorie.protobuf.DocumentProtos.Document.Token> tokens_ =
        java.util.Collections.emptyList();
      public java.util.List<cc.factorie.protobuf.DocumentProtos.Document.Token> getTokensList() {
        return tokens_;
      }
      public int getTokensCount() { return tokens_.size(); }
      public cc.factorie.protobuf.DocumentProtos.Document.Token getTokens(int index) {
        return tokens_.get(index);
      }
      
      // repeated .distant.protobuf.Document.Mention mentions = 2;
      public static final int MENTIONS_FIELD_NUMBER = 2;
      private java.util.List<cc.factorie.protobuf.DocumentProtos.Document.Mention> mentions_ =
        java.util.Collections.emptyList();
      public java.util.List<cc.factorie.protobuf.DocumentProtos.Document.Mention> getMentionsList() {
        return mentions_;
      }
      public int getMentionsCount() { return mentions_.size(); }
      public cc.factorie.protobuf.DocumentProtos.Document.Mention getMentions(int index) {
        return mentions_.get(index);
      }
      
      // optional .distant.protobuf.Document.DepTree depTree = 3;
      public static final int DEPTREE_FIELD_NUMBER = 3;
      private boolean hasDepTree;
      private cc.factorie.protobuf.DocumentProtos.Document.DepTree depTree_;
      public boolean hasDepTree() { return hasDepTree; }
      public cc.factorie.protobuf.DocumentProtos.Document.DepTree getDepTree() { return depTree_; }
      
      private void initFields() {
        depTree_ = cc.factorie.protobuf.DocumentProtos.Document.DepTree.getDefaultInstance();
      }
      public final boolean isInitialized() {
        for (cc.factorie.protobuf.DocumentProtos.Document.Token element : getTokensList()) {
          if (!element.isInitialized()) return false;
        }
        for (cc.factorie.protobuf.DocumentProtos.Document.Mention element : getMentionsList()) {
          if (!element.isInitialized()) return false;
        }
        if (hasDepTree()) {
          if (!getDepTree().isInitialized()) return false;
        }
        return true;
      }
      
      public void writeTo(com.google.protobuf.CodedOutputStream output)
                          throws java.io.IOException {
        getSerializedSize();
        for (cc.factorie.protobuf.DocumentProtos.Document.Token element : getTokensList()) {
          output.writeMessage(1, element);
        }
        for (cc.factorie.protobuf.DocumentProtos.Document.Mention element : getMentionsList()) {
          output.writeMessage(2, element);
        }
        if (hasDepTree()) {
          output.writeMessage(3, getDepTree());
        }
        getUnknownFields().writeTo(output);
      }
      
      private int memoizedSerializedSize = -1;
      public int getSerializedSize() {
        int size = memoizedSerializedSize;
        if (size != -1) return size;
      
        size = 0;
        for (cc.factorie.protobuf.DocumentProtos.Document.Token element : getTokensList()) {
          size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(1, element);
        }
        for (cc.factorie.protobuf.DocumentProtos.Document.Mention element : getMentionsList()) {
          size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(2, element);
        }
        if (hasDepTree()) {
          size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(3, getDepTree());
        }
        size += getUnknownFields().getSerializedSize();
        memoizedSerializedSize = size;
        return size;
      }
      
      public static cc.factorie.protobuf.DocumentProtos.Document.Sentence parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Sentence parseFrom(
          com.google.protobuf.ByteString data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Sentence parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Sentence parseFrom(
          byte[] data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Sentence parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Sentence parseFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Sentence parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Sentence parseDelimitedFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Sentence parseFrom(
          com.google.protobuf.CodedInputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Sentence parseFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      
      public static Builder newBuilder() { return Builder.create(); }
      public Builder newBuilderForType() { return newBuilder(); }
      public static Builder newBuilder(cc.factorie.protobuf.DocumentProtos.Document.Sentence prototype) {
        return newBuilder().mergeFrom(prototype);
      }
      public Builder toBuilder() { return newBuilder(this); }
      
      public static final class Builder extends
          com.google.protobuf.GeneratedMessage.Builder<Builder> {
        private cc.factorie.protobuf.DocumentProtos.Document.Sentence result;
        
        // Construct using cc.factorie.protobuf.DocumentProtos.Document.Sentence.newBuilder()
        private Builder() {}
        
        private static Builder create() {
          Builder builder = new Builder();
          builder.result = new cc.factorie.protobuf.DocumentProtos.Document.Sentence();
          return builder;
        }
        
        protected cc.factorie.protobuf.DocumentProtos.Document.Sentence internalGetResult() {
          return result;
        }
        
        public Builder clear() {
          if (result == null) {
            throw new IllegalStateException(
              "Cannot call clear() after build().");
          }
          result = new cc.factorie.protobuf.DocumentProtos.Document.Sentence();
          return this;
        }
        
        public Builder clone() {
          return create().mergeFrom(result);
        }
        
        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return cc.factorie.protobuf.DocumentProtos.Document.Sentence.getDescriptor();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Document.Sentence getDefaultInstanceForType() {
          return cc.factorie.protobuf.DocumentProtos.Document.Sentence.getDefaultInstance();
        }
        
        public boolean isInitialized() {
          return result.isInitialized();
        }
        public cc.factorie.protobuf.DocumentProtos.Document.Sentence build() {
          if (result != null && !isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return buildPartial();
        }
        
        private cc.factorie.protobuf.DocumentProtos.Document.Sentence buildParsed()
            throws com.google.protobuf.InvalidProtocolBufferException {
          if (!isInitialized()) {
            throw newUninitializedMessageException(
              result).asInvalidProtocolBufferException();
          }
          return buildPartial();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Document.Sentence buildPartial() {
          if (result == null) {
            throw new IllegalStateException(
              "build() has already been called on this Builder.");
          }
          if (result.tokens_ != java.util.Collections.EMPTY_LIST) {
            result.tokens_ =
              java.util.Collections.unmodifiableList(result.tokens_);
          }
          if (result.mentions_ != java.util.Collections.EMPTY_LIST) {
            result.mentions_ =
              java.util.Collections.unmodifiableList(result.mentions_);
          }
          cc.factorie.protobuf.DocumentProtos.Document.Sentence returnMe = result;
          result = null;
          return returnMe;
        }
        
        public Builder mergeFrom(com.google.protobuf.Message other) {
          if (other instanceof cc.factorie.protobuf.DocumentProtos.Document.Sentence) {
            return mergeFrom((cc.factorie.protobuf.DocumentProtos.Document.Sentence)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }
        
        public Builder mergeFrom(cc.factorie.protobuf.DocumentProtos.Document.Sentence other) {
          if (other == cc.factorie.protobuf.DocumentProtos.Document.Sentence.getDefaultInstance()) return this;
          if (!other.tokens_.isEmpty()) {
            if (result.tokens_.isEmpty()) {
              result.tokens_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Document.Token>();
            }
            result.tokens_.addAll(other.tokens_);
          }
          if (!other.mentions_.isEmpty()) {
            if (result.mentions_.isEmpty()) {
              result.mentions_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Document.Mention>();
            }
            result.mentions_.addAll(other.mentions_);
          }
          if (other.hasDepTree()) {
            mergeDepTree(other.getDepTree());
          }
          this.mergeUnknownFields(other.getUnknownFields());
          return this;
        }
        
        public Builder mergeFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
          com.google.protobuf.UnknownFieldSet.Builder unknownFields =
            com.google.protobuf.UnknownFieldSet.newBuilder(
              this.getUnknownFields());
          while (true) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                this.setUnknownFields(unknownFields.build());
                return this;
              default: {
                if (!parseUnknownField(input, unknownFields,
                                       extensionRegistry, tag)) {
                  this.setUnknownFields(unknownFields.build());
                  return this;
                }
                break;
              }
              case 10: {
                cc.factorie.protobuf.DocumentProtos.Document.Token.Builder subBuilder = cc.factorie.protobuf.DocumentProtos.Document.Token.newBuilder();
                input.readMessage(subBuilder, extensionRegistry);
                addTokens(subBuilder.buildPartial());
                break;
              }
              case 18: {
                cc.factorie.protobuf.DocumentProtos.Document.Mention.Builder subBuilder = cc.factorie.protobuf.DocumentProtos.Document.Mention.newBuilder();
                input.readMessage(subBuilder, extensionRegistry);
                addMentions(subBuilder.buildPartial());
                break;
              }
              case 26: {
                cc.factorie.protobuf.DocumentProtos.Document.DepTree.Builder subBuilder = cc.factorie.protobuf.DocumentProtos.Document.DepTree.newBuilder();
                if (hasDepTree()) {
                  subBuilder.mergeFrom(getDepTree());
                }
                input.readMessage(subBuilder, extensionRegistry);
                setDepTree(subBuilder.buildPartial());
                break;
              }
            }
          }
        }
        
        
        // repeated .distant.protobuf.Document.Token tokens = 1;
        public java.util.List<cc.factorie.protobuf.DocumentProtos.Document.Token> getTokensList() {
          return java.util.Collections.unmodifiableList(result.tokens_);
        }
        public int getTokensCount() {
          return result.getTokensCount();
        }
        public cc.factorie.protobuf.DocumentProtos.Document.Token getTokens(int index) {
          return result.getTokens(index);
        }
        public Builder setTokens(int index, cc.factorie.protobuf.DocumentProtos.Document.Token value) {
          if (value == null) {
            throw new NullPointerException();
          }
          result.tokens_.set(index, value);
          return this;
        }
        public Builder setTokens(int index, cc.factorie.protobuf.DocumentProtos.Document.Token.Builder builderForValue) {
          result.tokens_.set(index, builderForValue.build());
          return this;
        }
        public Builder addTokens(cc.factorie.protobuf.DocumentProtos.Document.Token value) {
          if (value == null) {
            throw new NullPointerException();
          }
          if (result.tokens_.isEmpty()) {
            result.tokens_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Document.Token>();
          }
          result.tokens_.add(value);
          return this;
        }
        public Builder addTokens(cc.factorie.protobuf.DocumentProtos.Document.Token.Builder builderForValue) {
          if (result.tokens_.isEmpty()) {
            result.tokens_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Document.Token>();
          }
          result.tokens_.add(builderForValue.build());
          return this;
        }
        public Builder addAllTokens(
            java.lang.Iterable<? extends cc.factorie.protobuf.DocumentProtos.Document.Token> values) {
          if (result.tokens_.isEmpty()) {
            result.tokens_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Document.Token>();
          }
          super.addAll(values, result.tokens_);
          return this;
        }
        public Builder clearTokens() {
          result.tokens_ = java.util.Collections.emptyList();
          return this;
        }
        
        // repeated .distant.protobuf.Document.Mention mentions = 2;
        public java.util.List<cc.factorie.protobuf.DocumentProtos.Document.Mention> getMentionsList() {
          return java.util.Collections.unmodifiableList(result.mentions_);
        }
        public int getMentionsCount() {
          return result.getMentionsCount();
        }
        public cc.factorie.protobuf.DocumentProtos.Document.Mention getMentions(int index) {
          return result.getMentions(index);
        }
        public Builder setMentions(int index, cc.factorie.protobuf.DocumentProtos.Document.Mention value) {
          if (value == null) {
            throw new NullPointerException();
          }
          result.mentions_.set(index, value);
          return this;
        }
        public Builder setMentions(int index, cc.factorie.protobuf.DocumentProtos.Document.Mention.Builder builderForValue) {
          result.mentions_.set(index, builderForValue.build());
          return this;
        }
        public Builder addMentions(cc.factorie.protobuf.DocumentProtos.Document.Mention value) {
          if (value == null) {
            throw new NullPointerException();
          }
          if (result.mentions_.isEmpty()) {
            result.mentions_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Document.Mention>();
          }
          result.mentions_.add(value);
          return this;
        }
        public Builder addMentions(cc.factorie.protobuf.DocumentProtos.Document.Mention.Builder builderForValue) {
          if (result.mentions_.isEmpty()) {
            result.mentions_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Document.Mention>();
          }
          result.mentions_.add(builderForValue.build());
          return this;
        }
        public Builder addAllMentions(
            java.lang.Iterable<? extends cc.factorie.protobuf.DocumentProtos.Document.Mention> values) {
          if (result.mentions_.isEmpty()) {
            result.mentions_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Document.Mention>();
          }
          super.addAll(values, result.mentions_);
          return this;
        }
        public Builder clearMentions() {
          result.mentions_ = java.util.Collections.emptyList();
          return this;
        }
        
        // optional .distant.protobuf.Document.DepTree depTree = 3;
        public boolean hasDepTree() {
          return result.hasDepTree();
        }
        public cc.factorie.protobuf.DocumentProtos.Document.DepTree getDepTree() {
          return result.getDepTree();
        }
        public Builder setDepTree(cc.factorie.protobuf.DocumentProtos.Document.DepTree value) {
          if (value == null) {
            throw new NullPointerException();
          }
          result.hasDepTree = true;
          result.depTree_ = value;
          return this;
        }
        public Builder setDepTree(cc.factorie.protobuf.DocumentProtos.Document.DepTree.Builder builderForValue) {
          result.hasDepTree = true;
          result.depTree_ = builderForValue.build();
          return this;
        }
        public Builder mergeDepTree(cc.factorie.protobuf.DocumentProtos.Document.DepTree value) {
          if (result.hasDepTree() &&
              result.depTree_ != cc.factorie.protobuf.DocumentProtos.Document.DepTree.getDefaultInstance()) {
            result.depTree_ =
              cc.factorie.protobuf.DocumentProtos.Document.DepTree.newBuilder(result.depTree_).mergeFrom(value).buildPartial();
          } else {
            result.depTree_ = value;
          }
          result.hasDepTree = true;
          return this;
        }
        public Builder clearDepTree() {
          result.hasDepTree = false;
          result.depTree_ = cc.factorie.protobuf.DocumentProtos.Document.DepTree.getDefaultInstance();
          return this;
        }
        
        // @@protoc_insertion_point(builder_scope:distant.protobuf.Document.Sentence)
      }
      
      static {
        defaultInstance = new Sentence(true);
        cc.factorie.protobuf.DocumentProtos.internalForceInit();
        defaultInstance.initFields();
      }
      
      // @@protoc_insertion_point(class_scope:distant.protobuf.Document.Sentence)
    }
    
    public static final class Token extends
        com.google.protobuf.GeneratedMessage {
      // Use Token.newBuilder() to construct.
      private Token() {
        initFields();
      }
      private Token(boolean noInit) {}
      
      private static final Token defaultInstance;
      public static Token getDefaultInstance() {
        return defaultInstance;
      }
      
      public Token getDefaultInstanceForType() {
        return defaultInstance;
      }
      
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Document_Token_descriptor;
      }
      
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Document_Token_fieldAccessorTable;
      }
      
      // required string word = 1;
      public static final int WORD_FIELD_NUMBER = 1;
      private boolean hasWord;
      private java.lang.String word_ = "";
      public boolean hasWord() { return hasWord; }
      public java.lang.String getWord() { return word_; }
      
      // optional string tag = 2;
      public static final int TAG_FIELD_NUMBER = 2;
      private boolean hasTag;
      private java.lang.String tag_ = "";
      public boolean hasTag() { return hasTag; }
      public java.lang.String getTag() { return tag_; }
      
      // optional string ner = 3;
      public static final int NER_FIELD_NUMBER = 3;
      private boolean hasNer;
      private java.lang.String ner_ = "";
      public boolean hasNer() { return hasNer; }
      public java.lang.String getNer() { return ner_; }
      
      private void initFields() {
      }
      public final boolean isInitialized() {
        if (!hasWord) return false;
        return true;
      }
      
      public void writeTo(com.google.protobuf.CodedOutputStream output)
                          throws java.io.IOException {
        getSerializedSize();
        if (hasWord()) {
          output.writeString(1, getWord());
        }
        if (hasTag()) {
          output.writeString(2, getTag());
        }
        if (hasNer()) {
          output.writeString(3, getNer());
        }
        getUnknownFields().writeTo(output);
      }
      
      private int memoizedSerializedSize = -1;
      public int getSerializedSize() {
        int size = memoizedSerializedSize;
        if (size != -1) return size;
      
        size = 0;
        if (hasWord()) {
          size += com.google.protobuf.CodedOutputStream
            .computeStringSize(1, getWord());
        }
        if (hasTag()) {
          size += com.google.protobuf.CodedOutputStream
            .computeStringSize(2, getTag());
        }
        if (hasNer()) {
          size += com.google.protobuf.CodedOutputStream
            .computeStringSize(3, getNer());
        }
        size += getUnknownFields().getSerializedSize();
        memoizedSerializedSize = size;
        return size;
      }
      
      public static cc.factorie.protobuf.DocumentProtos.Document.Token parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Token parseFrom(
          com.google.protobuf.ByteString data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Token parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Token parseFrom(
          byte[] data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Token parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Token parseFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Token parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Token parseDelimitedFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Token parseFrom(
          com.google.protobuf.CodedInputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Token parseFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      
      public static Builder newBuilder() { return Builder.create(); }
      public Builder newBuilderForType() { return newBuilder(); }
      public static Builder newBuilder(cc.factorie.protobuf.DocumentProtos.Document.Token prototype) {
        return newBuilder().mergeFrom(prototype);
      }
      public Builder toBuilder() { return newBuilder(this); }
      
      public static final class Builder extends
          com.google.protobuf.GeneratedMessage.Builder<Builder> {
        private cc.factorie.protobuf.DocumentProtos.Document.Token result;
        
        // Construct using cc.factorie.protobuf.DocumentProtos.Document.Token.newBuilder()
        private Builder() {}
        
        private static Builder create() {
          Builder builder = new Builder();
          builder.result = new cc.factorie.protobuf.DocumentProtos.Document.Token();
          return builder;
        }
        
        protected cc.factorie.protobuf.DocumentProtos.Document.Token internalGetResult() {
          return result;
        }
        
        public Builder clear() {
          if (result == null) {
            throw new IllegalStateException(
              "Cannot call clear() after build().");
          }
          result = new cc.factorie.protobuf.DocumentProtos.Document.Token();
          return this;
        }
        
        public Builder clone() {
          return create().mergeFrom(result);
        }
        
        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return cc.factorie.protobuf.DocumentProtos.Document.Token.getDescriptor();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Document.Token getDefaultInstanceForType() {
          return cc.factorie.protobuf.DocumentProtos.Document.Token.getDefaultInstance();
        }
        
        public boolean isInitialized() {
          return result.isInitialized();
        }
        public cc.factorie.protobuf.DocumentProtos.Document.Token build() {
          if (result != null && !isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return buildPartial();
        }
        
        private cc.factorie.protobuf.DocumentProtos.Document.Token buildParsed()
            throws com.google.protobuf.InvalidProtocolBufferException {
          if (!isInitialized()) {
            throw newUninitializedMessageException(
              result).asInvalidProtocolBufferException();
          }
          return buildPartial();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Document.Token buildPartial() {
          if (result == null) {
            throw new IllegalStateException(
              "build() has already been called on this Builder.");
          }
          cc.factorie.protobuf.DocumentProtos.Document.Token returnMe = result;
          result = null;
          return returnMe;
        }
        
        public Builder mergeFrom(com.google.protobuf.Message other) {
          if (other instanceof cc.factorie.protobuf.DocumentProtos.Document.Token) {
            return mergeFrom((cc.factorie.protobuf.DocumentProtos.Document.Token)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }
        
        public Builder mergeFrom(cc.factorie.protobuf.DocumentProtos.Document.Token other) {
          if (other == cc.factorie.protobuf.DocumentProtos.Document.Token.getDefaultInstance()) return this;
          if (other.hasWord()) {
            setWord(other.getWord());
          }
          if (other.hasTag()) {
            setTag(other.getTag());
          }
          if (other.hasNer()) {
            setNer(other.getNer());
          }
          this.mergeUnknownFields(other.getUnknownFields());
          return this;
        }
        
        public Builder mergeFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
          com.google.protobuf.UnknownFieldSet.Builder unknownFields =
            com.google.protobuf.UnknownFieldSet.newBuilder(
              this.getUnknownFields());
          while (true) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                this.setUnknownFields(unknownFields.build());
                return this;
              default: {
                if (!parseUnknownField(input, unknownFields,
                                       extensionRegistry, tag)) {
                  this.setUnknownFields(unknownFields.build());
                  return this;
                }
                break;
              }
              case 10: {
                setWord(input.readString());
                break;
              }
              case 18: {
                setTag(input.readString());
                break;
              }
              case 26: {
                setNer(input.readString());
                break;
              }
            }
          }
        }
        
        
        // required string word = 1;
        public boolean hasWord() {
          return result.hasWord();
        }
        public java.lang.String getWord() {
          return result.getWord();
        }
        public Builder setWord(java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  result.hasWord = true;
          result.word_ = value;
          return this;
        }
        public Builder clearWord() {
          result.hasWord = false;
          result.word_ = getDefaultInstance().getWord();
          return this;
        }
        
        // optional string tag = 2;
        public boolean hasTag() {
          return result.hasTag();
        }
        public java.lang.String getTag() {
          return result.getTag();
        }
        public Builder setTag(java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  result.hasTag = true;
          result.tag_ = value;
          return this;
        }
        public Builder clearTag() {
          result.hasTag = false;
          result.tag_ = getDefaultInstance().getTag();
          return this;
        }
        
        // optional string ner = 3;
        public boolean hasNer() {
          return result.hasNer();
        }
        public java.lang.String getNer() {
          return result.getNer();
        }
        public Builder setNer(java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  result.hasNer = true;
          result.ner_ = value;
          return this;
        }
        public Builder clearNer() {
          result.hasNer = false;
          result.ner_ = getDefaultInstance().getNer();
          return this;
        }
        
        // @@protoc_insertion_point(builder_scope:distant.protobuf.Document.Token)
      }
      
      static {
        defaultInstance = new Token(true);
        cc.factorie.protobuf.DocumentProtos.internalForceInit();
        defaultInstance.initFields();
      }
      
      // @@protoc_insertion_point(class_scope:distant.protobuf.Document.Token)
    }
    
    public static final class Mention extends
        com.google.protobuf.GeneratedMessage {
      // Use Mention.newBuilder() to construct.
      private Mention() {
        initFields();
      }
      private Mention(boolean noInit) {}
      
      private static final Mention defaultInstance;
      public static Mention getDefaultInstance() {
        return defaultInstance;
      }
      
      public Mention getDefaultInstanceForType() {
        return defaultInstance;
      }
      
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Document_Mention_descriptor;
      }
      
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Document_Mention_fieldAccessorTable;
      }
      
      // required int32 id = 1;
      public static final int ID_FIELD_NUMBER = 1;
      private boolean hasId;
      private int id_ = 0;
      public boolean hasId() { return hasId; }
      public int getId() { return id_; }
      
      // optional string entityGuid = 2;
      public static final int ENTITYGUID_FIELD_NUMBER = 2;
      private boolean hasEntityGuid;
      private java.lang.String entityGuid_ = "";
      public boolean hasEntityGuid() { return hasEntityGuid; }
      public java.lang.String getEntityGuid() { return entityGuid_; }
      
      // required int32 from = 3;
      public static final int FROM_FIELD_NUMBER = 3;
      private boolean hasFrom;
      private int from_ = 0;
      public boolean hasFrom() { return hasFrom; }
      public int getFrom() { return from_; }
      
      // required int32 to = 4;
      public static final int TO_FIELD_NUMBER = 4;
      private boolean hasTo;
      private int to_ = 0;
      public boolean hasTo() { return hasTo; }
      public int getTo() { return to_; }
      
      // required string label = 5;
      public static final int LABEL_FIELD_NUMBER = 5;
      private boolean hasLabel;
      private java.lang.String label_ = "";
      public boolean hasLabel() { return hasLabel; }
      public java.lang.String getLabel() { return label_; }
      
      private void initFields() {
      }
      public final boolean isInitialized() {
        if (!hasId) return false;
        if (!hasFrom) return false;
        if (!hasTo) return false;
        if (!hasLabel) return false;
        return true;
      }
      
      public void writeTo(com.google.protobuf.CodedOutputStream output)
                          throws java.io.IOException {
        getSerializedSize();
        if (hasId()) {
          output.writeInt32(1, getId());
        }
        if (hasEntityGuid()) {
          output.writeString(2, getEntityGuid());
        }
        if (hasFrom()) {
          output.writeInt32(3, getFrom());
        }
        if (hasTo()) {
          output.writeInt32(4, getTo());
        }
        if (hasLabel()) {
          output.writeString(5, getLabel());
        }
        getUnknownFields().writeTo(output);
      }
      
      private int memoizedSerializedSize = -1;
      public int getSerializedSize() {
        int size = memoizedSerializedSize;
        if (size != -1) return size;
      
        size = 0;
        if (hasId()) {
          size += com.google.protobuf.CodedOutputStream
            .computeInt32Size(1, getId());
        }
        if (hasEntityGuid()) {
          size += com.google.protobuf.CodedOutputStream
            .computeStringSize(2, getEntityGuid());
        }
        if (hasFrom()) {
          size += com.google.protobuf.CodedOutputStream
            .computeInt32Size(3, getFrom());
        }
        if (hasTo()) {
          size += com.google.protobuf.CodedOutputStream
            .computeInt32Size(4, getTo());
        }
        if (hasLabel()) {
          size += com.google.protobuf.CodedOutputStream
            .computeStringSize(5, getLabel());
        }
        size += getUnknownFields().getSerializedSize();
        memoizedSerializedSize = size;
        return size;
      }
      
      public static cc.factorie.protobuf.DocumentProtos.Document.Mention parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Mention parseFrom(
          com.google.protobuf.ByteString data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Mention parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Mention parseFrom(
          byte[] data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Mention parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Mention parseFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Mention parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Mention parseDelimitedFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Mention parseFrom(
          com.google.protobuf.CodedInputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.Mention parseFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      
      public static Builder newBuilder() { return Builder.create(); }
      public Builder newBuilderForType() { return newBuilder(); }
      public static Builder newBuilder(cc.factorie.protobuf.DocumentProtos.Document.Mention prototype) {
        return newBuilder().mergeFrom(prototype);
      }
      public Builder toBuilder() { return newBuilder(this); }
      
      public static final class Builder extends
          com.google.protobuf.GeneratedMessage.Builder<Builder> {
        private cc.factorie.protobuf.DocumentProtos.Document.Mention result;
        
        // Construct using cc.factorie.protobuf.DocumentProtos.Document.Mention.newBuilder()
        private Builder() {}
        
        private static Builder create() {
          Builder builder = new Builder();
          builder.result = new cc.factorie.protobuf.DocumentProtos.Document.Mention();
          return builder;
        }
        
        protected cc.factorie.protobuf.DocumentProtos.Document.Mention internalGetResult() {
          return result;
        }
        
        public Builder clear() {
          if (result == null) {
            throw new IllegalStateException(
              "Cannot call clear() after build().");
          }
          result = new cc.factorie.protobuf.DocumentProtos.Document.Mention();
          return this;
        }
        
        public Builder clone() {
          return create().mergeFrom(result);
        }
        
        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return cc.factorie.protobuf.DocumentProtos.Document.Mention.getDescriptor();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Document.Mention getDefaultInstanceForType() {
          return cc.factorie.protobuf.DocumentProtos.Document.Mention.getDefaultInstance();
        }
        
        public boolean isInitialized() {
          return result.isInitialized();
        }
        public cc.factorie.protobuf.DocumentProtos.Document.Mention build() {
          if (result != null && !isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return buildPartial();
        }
        
        private cc.factorie.protobuf.DocumentProtos.Document.Mention buildParsed()
            throws com.google.protobuf.InvalidProtocolBufferException {
          if (!isInitialized()) {
            throw newUninitializedMessageException(
              result).asInvalidProtocolBufferException();
          }
          return buildPartial();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Document.Mention buildPartial() {
          if (result == null) {
            throw new IllegalStateException(
              "build() has already been called on this Builder.");
          }
          cc.factorie.protobuf.DocumentProtos.Document.Mention returnMe = result;
          result = null;
          return returnMe;
        }
        
        public Builder mergeFrom(com.google.protobuf.Message other) {
          if (other instanceof cc.factorie.protobuf.DocumentProtos.Document.Mention) {
            return mergeFrom((cc.factorie.protobuf.DocumentProtos.Document.Mention)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }
        
        public Builder mergeFrom(cc.factorie.protobuf.DocumentProtos.Document.Mention other) {
          if (other == cc.factorie.protobuf.DocumentProtos.Document.Mention.getDefaultInstance()) return this;
          if (other.hasId()) {
            setId(other.getId());
          }
          if (other.hasEntityGuid()) {
            setEntityGuid(other.getEntityGuid());
          }
          if (other.hasFrom()) {
            setFrom(other.getFrom());
          }
          if (other.hasTo()) {
            setTo(other.getTo());
          }
          if (other.hasLabel()) {
            setLabel(other.getLabel());
          }
          this.mergeUnknownFields(other.getUnknownFields());
          return this;
        }
        
        public Builder mergeFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
          com.google.protobuf.UnknownFieldSet.Builder unknownFields =
            com.google.protobuf.UnknownFieldSet.newBuilder(
              this.getUnknownFields());
          while (true) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                this.setUnknownFields(unknownFields.build());
                return this;
              default: {
                if (!parseUnknownField(input, unknownFields,
                                       extensionRegistry, tag)) {
                  this.setUnknownFields(unknownFields.build());
                  return this;
                }
                break;
              }
              case 8: {
                setId(input.readInt32());
                break;
              }
              case 18: {
                setEntityGuid(input.readString());
                break;
              }
              case 24: {
                setFrom(input.readInt32());
                break;
              }
              case 32: {
                setTo(input.readInt32());
                break;
              }
              case 42: {
                setLabel(input.readString());
                break;
              }
            }
          }
        }
        
        
        // required int32 id = 1;
        public boolean hasId() {
          return result.hasId();
        }
        public int getId() {
          return result.getId();
        }
        public Builder setId(int value) {
          result.hasId = true;
          result.id_ = value;
          return this;
        }
        public Builder clearId() {
          result.hasId = false;
          result.id_ = 0;
          return this;
        }
        
        // optional string entityGuid = 2;
        public boolean hasEntityGuid() {
          return result.hasEntityGuid();
        }
        public java.lang.String getEntityGuid() {
          return result.getEntityGuid();
        }
        public Builder setEntityGuid(java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  result.hasEntityGuid = true;
          result.entityGuid_ = value;
          return this;
        }
        public Builder clearEntityGuid() {
          result.hasEntityGuid = false;
          result.entityGuid_ = getDefaultInstance().getEntityGuid();
          return this;
        }
        
        // required int32 from = 3;
        public boolean hasFrom() {
          return result.hasFrom();
        }
        public int getFrom() {
          return result.getFrom();
        }
        public Builder setFrom(int value) {
          result.hasFrom = true;
          result.from_ = value;
          return this;
        }
        public Builder clearFrom() {
          result.hasFrom = false;
          result.from_ = 0;
          return this;
        }
        
        // required int32 to = 4;
        public boolean hasTo() {
          return result.hasTo();
        }
        public int getTo() {
          return result.getTo();
        }
        public Builder setTo(int value) {
          result.hasTo = true;
          result.to_ = value;
          return this;
        }
        public Builder clearTo() {
          result.hasTo = false;
          result.to_ = 0;
          return this;
        }
        
        // required string label = 5;
        public boolean hasLabel() {
          return result.hasLabel();
        }
        public java.lang.String getLabel() {
          return result.getLabel();
        }
        public Builder setLabel(java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  result.hasLabel = true;
          result.label_ = value;
          return this;
        }
        public Builder clearLabel() {
          result.hasLabel = false;
          result.label_ = getDefaultInstance().getLabel();
          return this;
        }
        
        // @@protoc_insertion_point(builder_scope:distant.protobuf.Document.Mention)
      }
      
      static {
        defaultInstance = new Mention(true);
        cc.factorie.protobuf.DocumentProtos.internalForceInit();
        defaultInstance.initFields();
      }
      
      // @@protoc_insertion_point(class_scope:distant.protobuf.Document.Mention)
    }
    
    public static final class DepTree extends
        com.google.protobuf.GeneratedMessage {
      // Use DepTree.newBuilder() to construct.
      private DepTree() {
        initFields();
      }
      private DepTree(boolean noInit) {}
      
      private static final DepTree defaultInstance;
      public static DepTree getDefaultInstance() {
        return defaultInstance;
      }
      
      public DepTree getDefaultInstanceForType() {
        return defaultInstance;
      }
      
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Document_DepTree_descriptor;
      }
      
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Document_DepTree_fieldAccessorTable;
      }
      
      // required int32 root = 1;
      public static final int ROOT_FIELD_NUMBER = 1;
      private boolean hasRoot;
      private int root_ = 0;
      public boolean hasRoot() { return hasRoot; }
      public int getRoot() { return root_; }
      
      // repeated int32 head = 2;
      public static final int HEAD_FIELD_NUMBER = 2;
      private java.util.List<java.lang.Integer> head_ =
        java.util.Collections.emptyList();
      public java.util.List<java.lang.Integer> getHeadList() {
        return head_;
      }
      public int getHeadCount() { return head_.size(); }
      public int getHead(int index) {
        return head_.get(index);
      }
      
      // repeated string relType = 3;
      public static final int RELTYPE_FIELD_NUMBER = 3;
      private java.util.List<java.lang.String> relType_ =
        java.util.Collections.emptyList();
      public java.util.List<java.lang.String> getRelTypeList() {
        return relType_;
      }
      public int getRelTypeCount() { return relType_.size(); }
      public java.lang.String getRelType(int index) {
        return relType_.get(index);
      }
      
      private void initFields() {
      }
      public final boolean isInitialized() {
        if (!hasRoot) return false;
        return true;
      }
      
      public void writeTo(com.google.protobuf.CodedOutputStream output)
                          throws java.io.IOException {
        getSerializedSize();
        if (hasRoot()) {
          output.writeInt32(1, getRoot());
        }
        for (int element : getHeadList()) {
          output.writeInt32(2, element);
        }
        for (java.lang.String element : getRelTypeList()) {
          output.writeString(3, element);
        }
        getUnknownFields().writeTo(output);
      }
      
      private int memoizedSerializedSize = -1;
      public int getSerializedSize() {
        int size = memoizedSerializedSize;
        if (size != -1) return size;
      
        size = 0;
        if (hasRoot()) {
          size += com.google.protobuf.CodedOutputStream
            .computeInt32Size(1, getRoot());
        }
        {
          int dataSize = 0;
          for (int element : getHeadList()) {
            dataSize += com.google.protobuf.CodedOutputStream
              .computeInt32SizeNoTag(element);
          }
          size += dataSize;
          size += 1 * getHeadList().size();
        }
        {
          int dataSize = 0;
          for (java.lang.String element : getRelTypeList()) {
            dataSize += com.google.protobuf.CodedOutputStream
              .computeStringSizeNoTag(element);
          }
          size += dataSize;
          size += 1 * getRelTypeList().size();
        }
        size += getUnknownFields().getSerializedSize();
        memoizedSerializedSize = size;
        return size;
      }
      
      public static cc.factorie.protobuf.DocumentProtos.Document.DepTree parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.DepTree parseFrom(
          com.google.protobuf.ByteString data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.DepTree parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.DepTree parseFrom(
          byte[] data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.DepTree parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.DepTree parseFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.DepTree parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.DepTree parseDelimitedFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.DepTree parseFrom(
          com.google.protobuf.CodedInputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.DepTree parseFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      
      public static Builder newBuilder() { return Builder.create(); }
      public Builder newBuilderForType() { return newBuilder(); }
      public static Builder newBuilder(cc.factorie.protobuf.DocumentProtos.Document.DepTree prototype) {
        return newBuilder().mergeFrom(prototype);
      }
      public Builder toBuilder() { return newBuilder(this); }
      
      public static final class Builder extends
          com.google.protobuf.GeneratedMessage.Builder<Builder> {
        private cc.factorie.protobuf.DocumentProtos.Document.DepTree result;
        
        // Construct using cc.factorie.protobuf.DocumentProtos.Document.DepTree.newBuilder()
        private Builder() {}
        
        private static Builder create() {
          Builder builder = new Builder();
          builder.result = new cc.factorie.protobuf.DocumentProtos.Document.DepTree();
          return builder;
        }
        
        protected cc.factorie.protobuf.DocumentProtos.Document.DepTree internalGetResult() {
          return result;
        }
        
        public Builder clear() {
          if (result == null) {
            throw new IllegalStateException(
              "Cannot call clear() after build().");
          }
          result = new cc.factorie.protobuf.DocumentProtos.Document.DepTree();
          return this;
        }
        
        public Builder clone() {
          return create().mergeFrom(result);
        }
        
        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return cc.factorie.protobuf.DocumentProtos.Document.DepTree.getDescriptor();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Document.DepTree getDefaultInstanceForType() {
          return cc.factorie.protobuf.DocumentProtos.Document.DepTree.getDefaultInstance();
        }
        
        public boolean isInitialized() {
          return result.isInitialized();
        }
        public cc.factorie.protobuf.DocumentProtos.Document.DepTree build() {
          if (result != null && !isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return buildPartial();
        }
        
        private cc.factorie.protobuf.DocumentProtos.Document.DepTree buildParsed()
            throws com.google.protobuf.InvalidProtocolBufferException {
          if (!isInitialized()) {
            throw newUninitializedMessageException(
              result).asInvalidProtocolBufferException();
          }
          return buildPartial();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Document.DepTree buildPartial() {
          if (result == null) {
            throw new IllegalStateException(
              "build() has already been called on this Builder.");
          }
          if (result.head_ != java.util.Collections.EMPTY_LIST) {
            result.head_ =
              java.util.Collections.unmodifiableList(result.head_);
          }
          if (result.relType_ != java.util.Collections.EMPTY_LIST) {
            result.relType_ =
              java.util.Collections.unmodifiableList(result.relType_);
          }
          cc.factorie.protobuf.DocumentProtos.Document.DepTree returnMe = result;
          result = null;
          return returnMe;
        }
        
        public Builder mergeFrom(com.google.protobuf.Message other) {
          if (other instanceof cc.factorie.protobuf.DocumentProtos.Document.DepTree) {
            return mergeFrom((cc.factorie.protobuf.DocumentProtos.Document.DepTree)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }
        
        public Builder mergeFrom(cc.factorie.protobuf.DocumentProtos.Document.DepTree other) {
          if (other == cc.factorie.protobuf.DocumentProtos.Document.DepTree.getDefaultInstance()) return this;
          if (other.hasRoot()) {
            setRoot(other.getRoot());
          }
          if (!other.head_.isEmpty()) {
            if (result.head_.isEmpty()) {
              result.head_ = new java.util.ArrayList<java.lang.Integer>();
            }
            result.head_.addAll(other.head_);
          }
          if (!other.relType_.isEmpty()) {
            if (result.relType_.isEmpty()) {
              result.relType_ = new java.util.ArrayList<java.lang.String>();
            }
            result.relType_.addAll(other.relType_);
          }
          this.mergeUnknownFields(other.getUnknownFields());
          return this;
        }
        
        public Builder mergeFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
          com.google.protobuf.UnknownFieldSet.Builder unknownFields =
            com.google.protobuf.UnknownFieldSet.newBuilder(
              this.getUnknownFields());
          while (true) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                this.setUnknownFields(unknownFields.build());
                return this;
              default: {
                if (!parseUnknownField(input, unknownFields,
                                       extensionRegistry, tag)) {
                  this.setUnknownFields(unknownFields.build());
                  return this;
                }
                break;
              }
              case 8: {
                setRoot(input.readInt32());
                break;
              }
              case 16: {
                addHead(input.readInt32());
                break;
              }
              case 18: {
                int length = input.readRawVarint32();
                int limit = input.pushLimit(length);
                while (input.getBytesUntilLimit() > 0) {
                  addHead(input.readInt32());
                }
                input.popLimit(limit);
                break;
              }
              case 26: {
                addRelType(input.readString());
                break;
              }
            }
          }
        }
        
        
        // required int32 root = 1;
        public boolean hasRoot() {
          return result.hasRoot();
        }
        public int getRoot() {
          return result.getRoot();
        }
        public Builder setRoot(int value) {
          result.hasRoot = true;
          result.root_ = value;
          return this;
        }
        public Builder clearRoot() {
          result.hasRoot = false;
          result.root_ = 0;
          return this;
        }
        
        // repeated int32 head = 2;
        public java.util.List<java.lang.Integer> getHeadList() {
          return java.util.Collections.unmodifiableList(result.head_);
        }
        public int getHeadCount() {
          return result.getHeadCount();
        }
        public int getHead(int index) {
          return result.getHead(index);
        }
        public Builder setHead(int index, int value) {
          result.head_.set(index, value);
          return this;
        }
        public Builder addHead(int value) {
          if (result.head_.isEmpty()) {
            result.head_ = new java.util.ArrayList<java.lang.Integer>();
          }
          result.head_.add(value);
          return this;
        }
        public Builder addAllHead(
            java.lang.Iterable<? extends java.lang.Integer> values) {
          if (result.head_.isEmpty()) {
            result.head_ = new java.util.ArrayList<java.lang.Integer>();
          }
          super.addAll(values, result.head_);
          return this;
        }
        public Builder clearHead() {
          result.head_ = java.util.Collections.emptyList();
          return this;
        }
        
        // repeated string relType = 3;
        public java.util.List<java.lang.String> getRelTypeList() {
          return java.util.Collections.unmodifiableList(result.relType_);
        }
        public int getRelTypeCount() {
          return result.getRelTypeCount();
        }
        public java.lang.String getRelType(int index) {
          return result.getRelType(index);
        }
        public Builder setRelType(int index, java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  result.relType_.set(index, value);
          return this;
        }
        public Builder addRelType(java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  if (result.relType_.isEmpty()) {
            result.relType_ = new java.util.ArrayList<java.lang.String>();
          }
          result.relType_.add(value);
          return this;
        }
        public Builder addAllRelType(
            java.lang.Iterable<? extends java.lang.String> values) {
          if (result.relType_.isEmpty()) {
            result.relType_ = new java.util.ArrayList<java.lang.String>();
          }
          super.addAll(values, result.relType_);
          return this;
        }
        public Builder clearRelType() {
          result.relType_ = java.util.Collections.emptyList();
          return this;
        }
        
        // @@protoc_insertion_point(builder_scope:distant.protobuf.Document.DepTree)
      }
      
      static {
        defaultInstance = new DepTree(true);
        cc.factorie.protobuf.DocumentProtos.internalForceInit();
        defaultInstance.initFields();
      }
      
      // @@protoc_insertion_point(class_scope:distant.protobuf.Document.DepTree)
    }
    
    public static final class RelationMention extends
        com.google.protobuf.GeneratedMessage {
      // Use RelationMention.newBuilder() to construct.
      private RelationMention() {
        initFields();
      }
      private RelationMention(boolean noInit) {}
      
      private static final RelationMention defaultInstance;
      public static RelationMention getDefaultInstance() {
        return defaultInstance;
      }
      
      public RelationMention getDefaultInstanceForType() {
        return defaultInstance;
      }
      
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Document_RelationMention_descriptor;
      }
      
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Document_RelationMention_fieldAccessorTable;
      }
      
      // required int32 id = 1;
      public static final int ID_FIELD_NUMBER = 1;
      private boolean hasId;
      private int id_ = 0;
      public boolean hasId() { return hasId; }
      public int getId() { return id_; }
      
      // required int32 source = 2;
      public static final int SOURCE_FIELD_NUMBER = 2;
      private boolean hasSource;
      private int source_ = 0;
      public boolean hasSource() { return hasSource; }
      public int getSource() { return source_; }
      
      // required int32 dest = 3;
      public static final int DEST_FIELD_NUMBER = 3;
      private boolean hasDest;
      private int dest_ = 0;
      public boolean hasDest() { return hasDest; }
      public int getDest() { return dest_; }
      
      // required string label = 4;
      public static final int LABEL_FIELD_NUMBER = 4;
      private boolean hasLabel;
      private java.lang.String label_ = "";
      public boolean hasLabel() { return hasLabel; }
      public java.lang.String getLabel() { return label_; }
      
      private void initFields() {
      }
      public final boolean isInitialized() {
        if (!hasId) return false;
        if (!hasSource) return false;
        if (!hasDest) return false;
        if (!hasLabel) return false;
        return true;
      }
      
      public void writeTo(com.google.protobuf.CodedOutputStream output)
                          throws java.io.IOException {
        getSerializedSize();
        if (hasId()) {
          output.writeInt32(1, getId());
        }
        if (hasSource()) {
          output.writeInt32(2, getSource());
        }
        if (hasDest()) {
          output.writeInt32(3, getDest());
        }
        if (hasLabel()) {
          output.writeString(4, getLabel());
        }
        getUnknownFields().writeTo(output);
      }
      
      private int memoizedSerializedSize = -1;
      public int getSerializedSize() {
        int size = memoizedSerializedSize;
        if (size != -1) return size;
      
        size = 0;
        if (hasId()) {
          size += com.google.protobuf.CodedOutputStream
            .computeInt32Size(1, getId());
        }
        if (hasSource()) {
          size += com.google.protobuf.CodedOutputStream
            .computeInt32Size(2, getSource());
        }
        if (hasDest()) {
          size += com.google.protobuf.CodedOutputStream
            .computeInt32Size(3, getDest());
        }
        if (hasLabel()) {
          size += com.google.protobuf.CodedOutputStream
            .computeStringSize(4, getLabel());
        }
        size += getUnknownFields().getSerializedSize();
        memoizedSerializedSize = size;
        return size;
      }
      
      public static cc.factorie.protobuf.DocumentProtos.Document.RelationMention parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.RelationMention parseFrom(
          com.google.protobuf.ByteString data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.RelationMention parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.RelationMention parseFrom(
          byte[] data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.RelationMention parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.RelationMention parseFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.RelationMention parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.RelationMention parseDelimitedFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.RelationMention parseFrom(
          com.google.protobuf.CodedInputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Document.RelationMention parseFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      
      public static Builder newBuilder() { return Builder.create(); }
      public Builder newBuilderForType() { return newBuilder(); }
      public static Builder newBuilder(cc.factorie.protobuf.DocumentProtos.Document.RelationMention prototype) {
        return newBuilder().mergeFrom(prototype);
      }
      public Builder toBuilder() { return newBuilder(this); }
      
      public static final class Builder extends
          com.google.protobuf.GeneratedMessage.Builder<Builder> {
        private cc.factorie.protobuf.DocumentProtos.Document.RelationMention result;
        
        // Construct using cc.factorie.protobuf.DocumentProtos.Document.RelationMention.newBuilder()
        private Builder() {}
        
        private static Builder create() {
          Builder builder = new Builder();
          builder.result = new cc.factorie.protobuf.DocumentProtos.Document.RelationMention();
          return builder;
        }
        
        protected cc.factorie.protobuf.DocumentProtos.Document.RelationMention internalGetResult() {
          return result;
        }
        
        public Builder clear() {
          if (result == null) {
            throw new IllegalStateException(
              "Cannot call clear() after build().");
          }
          result = new cc.factorie.protobuf.DocumentProtos.Document.RelationMention();
          return this;
        }
        
        public Builder clone() {
          return create().mergeFrom(result);
        }
        
        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return cc.factorie.protobuf.DocumentProtos.Document.RelationMention.getDescriptor();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Document.RelationMention getDefaultInstanceForType() {
          return cc.factorie.protobuf.DocumentProtos.Document.RelationMention.getDefaultInstance();
        }
        
        public boolean isInitialized() {
          return result.isInitialized();
        }
        public cc.factorie.protobuf.DocumentProtos.Document.RelationMention build() {
          if (result != null && !isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return buildPartial();
        }
        
        private cc.factorie.protobuf.DocumentProtos.Document.RelationMention buildParsed()
            throws com.google.protobuf.InvalidProtocolBufferException {
          if (!isInitialized()) {
            throw newUninitializedMessageException(
              result).asInvalidProtocolBufferException();
          }
          return buildPartial();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Document.RelationMention buildPartial() {
          if (result == null) {
            throw new IllegalStateException(
              "build() has already been called on this Builder.");
          }
          cc.factorie.protobuf.DocumentProtos.Document.RelationMention returnMe = result;
          result = null;
          return returnMe;
        }
        
        public Builder mergeFrom(com.google.protobuf.Message other) {
          if (other instanceof cc.factorie.protobuf.DocumentProtos.Document.RelationMention) {
            return mergeFrom((cc.factorie.protobuf.DocumentProtos.Document.RelationMention)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }
        
        public Builder mergeFrom(cc.factorie.protobuf.DocumentProtos.Document.RelationMention other) {
          if (other == cc.factorie.protobuf.DocumentProtos.Document.RelationMention.getDefaultInstance()) return this;
          if (other.hasId()) {
            setId(other.getId());
          }
          if (other.hasSource()) {
            setSource(other.getSource());
          }
          if (other.hasDest()) {
            setDest(other.getDest());
          }
          if (other.hasLabel()) {
            setLabel(other.getLabel());
          }
          this.mergeUnknownFields(other.getUnknownFields());
          return this;
        }
        
        public Builder mergeFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
          com.google.protobuf.UnknownFieldSet.Builder unknownFields =
            com.google.protobuf.UnknownFieldSet.newBuilder(
              this.getUnknownFields());
          while (true) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                this.setUnknownFields(unknownFields.build());
                return this;
              default: {
                if (!parseUnknownField(input, unknownFields,
                                       extensionRegistry, tag)) {
                  this.setUnknownFields(unknownFields.build());
                  return this;
                }
                break;
              }
              case 8: {
                setId(input.readInt32());
                break;
              }
              case 16: {
                setSource(input.readInt32());
                break;
              }
              case 24: {
                setDest(input.readInt32());
                break;
              }
              case 34: {
                setLabel(input.readString());
                break;
              }
            }
          }
        }
        
        
        // required int32 id = 1;
        public boolean hasId() {
          return result.hasId();
        }
        public int getId() {
          return result.getId();
        }
        public Builder setId(int value) {
          result.hasId = true;
          result.id_ = value;
          return this;
        }
        public Builder clearId() {
          result.hasId = false;
          result.id_ = 0;
          return this;
        }
        
        // required int32 source = 2;
        public boolean hasSource() {
          return result.hasSource();
        }
        public int getSource() {
          return result.getSource();
        }
        public Builder setSource(int value) {
          result.hasSource = true;
          result.source_ = value;
          return this;
        }
        public Builder clearSource() {
          result.hasSource = false;
          result.source_ = 0;
          return this;
        }
        
        // required int32 dest = 3;
        public boolean hasDest() {
          return result.hasDest();
        }
        public int getDest() {
          return result.getDest();
        }
        public Builder setDest(int value) {
          result.hasDest = true;
          result.dest_ = value;
          return this;
        }
        public Builder clearDest() {
          result.hasDest = false;
          result.dest_ = 0;
          return this;
        }
        
        // required string label = 4;
        public boolean hasLabel() {
          return result.hasLabel();
        }
        public java.lang.String getLabel() {
          return result.getLabel();
        }
        public Builder setLabel(java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  result.hasLabel = true;
          result.label_ = value;
          return this;
        }
        public Builder clearLabel() {
          result.hasLabel = false;
          result.label_ = getDefaultInstance().getLabel();
          return this;
        }
        
        // @@protoc_insertion_point(builder_scope:distant.protobuf.Document.RelationMention)
      }
      
      static {
        defaultInstance = new RelationMention(true);
        cc.factorie.protobuf.DocumentProtos.internalForceInit();
        defaultInstance.initFields();
      }
      
      // @@protoc_insertion_point(class_scope:distant.protobuf.Document.RelationMention)
    }
    
    // required string filename = 1;
    public static final int FILENAME_FIELD_NUMBER = 1;
    private boolean hasFilename;
    private java.lang.String filename_ = "";
    public boolean hasFilename() { return hasFilename; }
    public java.lang.String getFilename() { return filename_; }
    
    // repeated .distant.protobuf.Document.Sentence sentences = 2;
    public static final int SENTENCES_FIELD_NUMBER = 2;
    private java.util.List<cc.factorie.protobuf.DocumentProtos.Document.Sentence> sentences_ =
      java.util.Collections.emptyList();
    public java.util.List<cc.factorie.protobuf.DocumentProtos.Document.Sentence> getSentencesList() {
      return sentences_;
    }
    public int getSentencesCount() { return sentences_.size(); }
    public cc.factorie.protobuf.DocumentProtos.Document.Sentence getSentences(int index) {
      return sentences_.get(index);
    }
    
    private void initFields() {
    }
    public final boolean isInitialized() {
      if (!hasFilename) return false;
      for (cc.factorie.protobuf.DocumentProtos.Document.Sentence element : getSentencesList()) {
        if (!element.isInitialized()) return false;
      }
      return true;
    }
    
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (hasFilename()) {
        output.writeString(1, getFilename());
      }
      for (cc.factorie.protobuf.DocumentProtos.Document.Sentence element : getSentencesList()) {
        output.writeMessage(2, element);
      }
      getUnknownFields().writeTo(output);
    }
    
    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;
    
      size = 0;
      if (hasFilename()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(1, getFilename());
      }
      for (cc.factorie.protobuf.DocumentProtos.Document.Sentence element : getSentencesList()) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, element);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }
    
    public static cc.factorie.protobuf.DocumentProtos.Document parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Document parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Document parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Document parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Document parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Document parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Document parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static cc.factorie.protobuf.DocumentProtos.Document parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static cc.factorie.protobuf.DocumentProtos.Document parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Document parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }
    
    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(cc.factorie.protobuf.DocumentProtos.Document prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }
    
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder> {
      private cc.factorie.protobuf.DocumentProtos.Document result;
      
      // Construct using cc.factorie.protobuf.DocumentProtos.Document.newBuilder()
      private Builder() {}
      
      private static Builder create() {
        Builder builder = new Builder();
        builder.result = new cc.factorie.protobuf.DocumentProtos.Document();
        return builder;
      }
      
      protected cc.factorie.protobuf.DocumentProtos.Document internalGetResult() {
        return result;
      }
      
      public Builder clear() {
        if (result == null) {
          throw new IllegalStateException(
            "Cannot call clear() after build().");
        }
        result = new cc.factorie.protobuf.DocumentProtos.Document();
        return this;
      }
      
      public Builder clone() {
        return create().mergeFrom(result);
      }
      
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return cc.factorie.protobuf.DocumentProtos.Document.getDescriptor();
      }
      
      public cc.factorie.protobuf.DocumentProtos.Document getDefaultInstanceForType() {
        return cc.factorie.protobuf.DocumentProtos.Document.getDefaultInstance();
      }
      
      public boolean isInitialized() {
        return result.isInitialized();
      }
      public cc.factorie.protobuf.DocumentProtos.Document build() {
        if (result != null && !isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return buildPartial();
      }
      
      private cc.factorie.protobuf.DocumentProtos.Document buildParsed()
          throws com.google.protobuf.InvalidProtocolBufferException {
        if (!isInitialized()) {
          throw newUninitializedMessageException(
            result).asInvalidProtocolBufferException();
        }
        return buildPartial();
      }
      
      public cc.factorie.protobuf.DocumentProtos.Document buildPartial() {
        if (result == null) {
          throw new IllegalStateException(
            "build() has already been called on this Builder.");
        }
        if (result.sentences_ != java.util.Collections.EMPTY_LIST) {
          result.sentences_ =
            java.util.Collections.unmodifiableList(result.sentences_);
        }
        cc.factorie.protobuf.DocumentProtos.Document returnMe = result;
        result = null;
        return returnMe;
      }
      
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof cc.factorie.protobuf.DocumentProtos.Document) {
          return mergeFrom((cc.factorie.protobuf.DocumentProtos.Document)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }
      
      public Builder mergeFrom(cc.factorie.protobuf.DocumentProtos.Document other) {
        if (other == cc.factorie.protobuf.DocumentProtos.Document.getDefaultInstance()) return this;
        if (other.hasFilename()) {
          setFilename(other.getFilename());
        }
        if (!other.sentences_.isEmpty()) {
          if (result.sentences_.isEmpty()) {
            result.sentences_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Document.Sentence>();
          }
          result.sentences_.addAll(other.sentences_);
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }
      
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder(
            this.getUnknownFields());
        while (true) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              this.setUnknownFields(unknownFields.build());
              return this;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                this.setUnknownFields(unknownFields.build());
                return this;
              }
              break;
            }
            case 10: {
              setFilename(input.readString());
              break;
            }
            case 18: {
              cc.factorie.protobuf.DocumentProtos.Document.Sentence.Builder subBuilder = cc.factorie.protobuf.DocumentProtos.Document.Sentence.newBuilder();
              input.readMessage(subBuilder, extensionRegistry);
              addSentences(subBuilder.buildPartial());
              break;
            }
          }
        }
      }
      
      
      // required string filename = 1;
      public boolean hasFilename() {
        return result.hasFilename();
      }
      public java.lang.String getFilename() {
        return result.getFilename();
      }
      public Builder setFilename(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasFilename = true;
        result.filename_ = value;
        return this;
      }
      public Builder clearFilename() {
        result.hasFilename = false;
        result.filename_ = getDefaultInstance().getFilename();
        return this;
      }
      
      // repeated .distant.protobuf.Document.Sentence sentences = 2;
      public java.util.List<cc.factorie.protobuf.DocumentProtos.Document.Sentence> getSentencesList() {
        return java.util.Collections.unmodifiableList(result.sentences_);
      }
      public int getSentencesCount() {
        return result.getSentencesCount();
      }
      public cc.factorie.protobuf.DocumentProtos.Document.Sentence getSentences(int index) {
        return result.getSentences(index);
      }
      public Builder setSentences(int index, cc.factorie.protobuf.DocumentProtos.Document.Sentence value) {
        if (value == null) {
          throw new NullPointerException();
        }
        result.sentences_.set(index, value);
        return this;
      }
      public Builder setSentences(int index, cc.factorie.protobuf.DocumentProtos.Document.Sentence.Builder builderForValue) {
        result.sentences_.set(index, builderForValue.build());
        return this;
      }
      public Builder addSentences(cc.factorie.protobuf.DocumentProtos.Document.Sentence value) {
        if (value == null) {
          throw new NullPointerException();
        }
        if (result.sentences_.isEmpty()) {
          result.sentences_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Document.Sentence>();
        }
        result.sentences_.add(value);
        return this;
      }
      public Builder addSentences(cc.factorie.protobuf.DocumentProtos.Document.Sentence.Builder builderForValue) {
        if (result.sentences_.isEmpty()) {
          result.sentences_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Document.Sentence>();
        }
        result.sentences_.add(builderForValue.build());
        return this;
      }
      public Builder addAllSentences(
          java.lang.Iterable<? extends cc.factorie.protobuf.DocumentProtos.Document.Sentence> values) {
        if (result.sentences_.isEmpty()) {
          result.sentences_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Document.Sentence>();
        }
        super.addAll(values, result.sentences_);
        return this;
      }
      public Builder clearSentences() {
        result.sentences_ = java.util.Collections.emptyList();
        return this;
      }
      
      // @@protoc_insertion_point(builder_scope:distant.protobuf.Document)
    }
    
    static {
      defaultInstance = new Document(true);
      cc.factorie.protobuf.DocumentProtos.internalForceInit();
      defaultInstance.initFields();
    }
    
    // @@protoc_insertion_point(class_scope:distant.protobuf.Document)
  }
  
  public static final class Relation extends
      com.google.protobuf.GeneratedMessage {
    // Use Relation.newBuilder() to construct.
    private Relation() {
      initFields();
    }
    private Relation(boolean noInit) {}
    
    private static final Relation defaultInstance;
    public static Relation getDefaultInstance() {
      return defaultInstance;
    }
    
    public Relation getDefaultInstanceForType() {
      return defaultInstance;
    }
    
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Relation_descriptor;
    }
    
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Relation_fieldAccessorTable;
    }
    
    public static final class RelationMentionRef extends
        com.google.protobuf.GeneratedMessage {
      // Use RelationMentionRef.newBuilder() to construct.
      private RelationMentionRef() {
        initFields();
      }
      private RelationMentionRef(boolean noInit) {}
      
      private static final RelationMentionRef defaultInstance;
      public static RelationMentionRef getDefaultInstance() {
        return defaultInstance;
      }
      
      public RelationMentionRef getDefaultInstanceForType() {
        return defaultInstance;
      }
      
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Relation_RelationMentionRef_descriptor;
      }
      
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Relation_RelationMentionRef_fieldAccessorTable;
      }
      
      // required string filename = 1;
      public static final int FILENAME_FIELD_NUMBER = 1;
      private boolean hasFilename;
      private java.lang.String filename_ = "";
      public boolean hasFilename() { return hasFilename; }
      public java.lang.String getFilename() { return filename_; }
      
      // required int32 sourceId = 2;
      public static final int SOURCEID_FIELD_NUMBER = 2;
      private boolean hasSourceId;
      private int sourceId_ = 0;
      public boolean hasSourceId() { return hasSourceId; }
      public int getSourceId() { return sourceId_; }
      
      // required int32 destId = 3;
      public static final int DESTID_FIELD_NUMBER = 3;
      private boolean hasDestId;
      private int destId_ = 0;
      public boolean hasDestId() { return hasDestId; }
      public int getDestId() { return destId_; }
      
      // repeated string feature = 4;
      public static final int FEATURE_FIELD_NUMBER = 4;
      private java.util.List<java.lang.String> feature_ =
        java.util.Collections.emptyList();
      public java.util.List<java.lang.String> getFeatureList() {
        return feature_;
      }
      public int getFeatureCount() { return feature_.size(); }
      public java.lang.String getFeature(int index) {
        return feature_.get(index);
      }
      
      // optional string sentence = 5;
      public static final int SENTENCE_FIELD_NUMBER = 5;
      private boolean hasSentence;
      private java.lang.String sentence_ = "";
      public boolean hasSentence() { return hasSentence; }
      public java.lang.String getSentence() { return sentence_; }
      
      private void initFields() {
      }
      public final boolean isInitialized() {
        if (!hasFilename) return false;
        if (!hasSourceId) return false;
        if (!hasDestId) return false;
        return true;
      }
      
      public void writeTo(com.google.protobuf.CodedOutputStream output)
                          throws java.io.IOException {
        getSerializedSize();
        if (hasFilename()) {
          output.writeString(1, getFilename());
        }
        if (hasSourceId()) {
          output.writeInt32(2, getSourceId());
        }
        if (hasDestId()) {
          output.writeInt32(3, getDestId());
        }
        for (java.lang.String element : getFeatureList()) {
          output.writeString(4, element);
        }
        if (hasSentence()) {
          output.writeString(5, getSentence());
        }
        getUnknownFields().writeTo(output);
      }
      
      private int memoizedSerializedSize = -1;
      public int getSerializedSize() {
        int size = memoizedSerializedSize;
        if (size != -1) return size;
      
        size = 0;
        if (hasFilename()) {
          size += com.google.protobuf.CodedOutputStream
            .computeStringSize(1, getFilename());
        }
        if (hasSourceId()) {
          size += com.google.protobuf.CodedOutputStream
            .computeInt32Size(2, getSourceId());
        }
        if (hasDestId()) {
          size += com.google.protobuf.CodedOutputStream
            .computeInt32Size(3, getDestId());
        }
        {
          int dataSize = 0;
          for (java.lang.String element : getFeatureList()) {
            dataSize += com.google.protobuf.CodedOutputStream
              .computeStringSizeNoTag(element);
          }
          size += dataSize;
          size += 1 * getFeatureList().size();
        }
        if (hasSentence()) {
          size += com.google.protobuf.CodedOutputStream
            .computeStringSize(5, getSentence());
        }
        size += getUnknownFields().getSerializedSize();
        memoizedSerializedSize = size;
        return size;
      }
      
      public static cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef parseFrom(
          com.google.protobuf.ByteString data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef parseFrom(
          byte[] data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef parseFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef parseDelimitedFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef parseFrom(
          com.google.protobuf.CodedInputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef parseFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      
      public static Builder newBuilder() { return Builder.create(); }
      public Builder newBuilderForType() { return newBuilder(); }
      public static Builder newBuilder(cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef prototype) {
        return newBuilder().mergeFrom(prototype);
      }
      public Builder toBuilder() { return newBuilder(this); }
      
      public static final class Builder extends
          com.google.protobuf.GeneratedMessage.Builder<Builder> {
        private cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef result;
        
        // Construct using cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef.newBuilder()
        private Builder() {}
        
        private static Builder create() {
          Builder builder = new Builder();
          builder.result = new cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef();
          return builder;
        }
        
        protected cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef internalGetResult() {
          return result;
        }
        
        public Builder clear() {
          if (result == null) {
            throw new IllegalStateException(
              "Cannot call clear() after build().");
          }
          result = new cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef();
          return this;
        }
        
        public Builder clone() {
          return create().mergeFrom(result);
        }
        
        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef.getDescriptor();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef getDefaultInstanceForType() {
          return cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef.getDefaultInstance();
        }
        
        public boolean isInitialized() {
          return result.isInitialized();
        }
        public cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef build() {
          if (result != null && !isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return buildPartial();
        }
        
        private cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef buildParsed()
            throws com.google.protobuf.InvalidProtocolBufferException {
          if (!isInitialized()) {
            throw newUninitializedMessageException(
              result).asInvalidProtocolBufferException();
          }
          return buildPartial();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef buildPartial() {
          if (result == null) {
            throw new IllegalStateException(
              "build() has already been called on this Builder.");
          }
          if (result.feature_ != java.util.Collections.EMPTY_LIST) {
            result.feature_ =
              java.util.Collections.unmodifiableList(result.feature_);
          }
          cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef returnMe = result;
          result = null;
          return returnMe;
        }
        
        public Builder mergeFrom(com.google.protobuf.Message other) {
          if (other instanceof cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef) {
            return mergeFrom((cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }
        
        public Builder mergeFrom(cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef other) {
          if (other == cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef.getDefaultInstance()) return this;
          if (other.hasFilename()) {
            setFilename(other.getFilename());
          }
          if (other.hasSourceId()) {
            setSourceId(other.getSourceId());
          }
          if (other.hasDestId()) {
            setDestId(other.getDestId());
          }
          if (!other.feature_.isEmpty()) {
            if (result.feature_.isEmpty()) {
              result.feature_ = new java.util.ArrayList<java.lang.String>();
            }
            result.feature_.addAll(other.feature_);
          }
          if (other.hasSentence()) {
            setSentence(other.getSentence());
          }
          this.mergeUnknownFields(other.getUnknownFields());
          return this;
        }
        
        public Builder mergeFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
          com.google.protobuf.UnknownFieldSet.Builder unknownFields =
            com.google.protobuf.UnknownFieldSet.newBuilder(
              this.getUnknownFields());
          while (true) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                this.setUnknownFields(unknownFields.build());
                return this;
              default: {
                if (!parseUnknownField(input, unknownFields,
                                       extensionRegistry, tag)) {
                  this.setUnknownFields(unknownFields.build());
                  return this;
                }
                break;
              }
              case 10: {
                setFilename(input.readString());
                break;
              }
              case 16: {
                setSourceId(input.readInt32());
                break;
              }
              case 24: {
                setDestId(input.readInt32());
                break;
              }
              case 34: {
                addFeature(input.readString());
                break;
              }
              case 42: {
                setSentence(input.readString());
                break;
              }
            }
          }
        }
        
        
        // required string filename = 1;
        public boolean hasFilename() {
          return result.hasFilename();
        }
        public java.lang.String getFilename() {
          return result.getFilename();
        }
        public Builder setFilename(java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  result.hasFilename = true;
          result.filename_ = value;
          return this;
        }
        public Builder clearFilename() {
          result.hasFilename = false;
          result.filename_ = getDefaultInstance().getFilename();
          return this;
        }
        
        // required int32 sourceId = 2;
        public boolean hasSourceId() {
          return result.hasSourceId();
        }
        public int getSourceId() {
          return result.getSourceId();
        }
        public Builder setSourceId(int value) {
          result.hasSourceId = true;
          result.sourceId_ = value;
          return this;
        }
        public Builder clearSourceId() {
          result.hasSourceId = false;
          result.sourceId_ = 0;
          return this;
        }
        
        // required int32 destId = 3;
        public boolean hasDestId() {
          return result.hasDestId();
        }
        public int getDestId() {
          return result.getDestId();
        }
        public Builder setDestId(int value) {
          result.hasDestId = true;
          result.destId_ = value;
          return this;
        }
        public Builder clearDestId() {
          result.hasDestId = false;
          result.destId_ = 0;
          return this;
        }
        
        // repeated string feature = 4;
        public java.util.List<java.lang.String> getFeatureList() {
          return java.util.Collections.unmodifiableList(result.feature_);
        }
        public int getFeatureCount() {
          return result.getFeatureCount();
        }
        public java.lang.String getFeature(int index) {
          return result.getFeature(index);
        }
        public Builder setFeature(int index, java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  result.feature_.set(index, value);
          return this;
        }
        public Builder addFeature(java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  if (result.feature_.isEmpty()) {
            result.feature_ = new java.util.ArrayList<java.lang.String>();
          }
          result.feature_.add(value);
          return this;
        }
        public Builder addAllFeature(
            java.lang.Iterable<? extends java.lang.String> values) {
          if (result.feature_.isEmpty()) {
            result.feature_ = new java.util.ArrayList<java.lang.String>();
          }
          super.addAll(values, result.feature_);
          return this;
        }
        public Builder clearFeature() {
          result.feature_ = java.util.Collections.emptyList();
          return this;
        }
        
        // optional string sentence = 5;
        public boolean hasSentence() {
          return result.hasSentence();
        }
        public java.lang.String getSentence() {
          return result.getSentence();
        }
        public Builder setSentence(java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  result.hasSentence = true;
          result.sentence_ = value;
          return this;
        }
        public Builder clearSentence() {
          result.hasSentence = false;
          result.sentence_ = getDefaultInstance().getSentence();
          return this;
        }
        
        // @@protoc_insertion_point(builder_scope:distant.protobuf.Relation.RelationMentionRef)
      }
      
      static {
        defaultInstance = new RelationMentionRef(true);
        cc.factorie.protobuf.DocumentProtos.internalForceInit();
        defaultInstance.initFields();
      }
      
      // @@protoc_insertion_point(class_scope:distant.protobuf.Relation.RelationMentionRef)
    }
    
    // required string sourceGuid = 1;
    public static final int SOURCEGUID_FIELD_NUMBER = 1;
    private boolean hasSourceGuid;
    private java.lang.String sourceGuid_ = "";
    public boolean hasSourceGuid() { return hasSourceGuid; }
    public java.lang.String getSourceGuid() { return sourceGuid_; }
    
    // required string destGuid = 2;
    public static final int DESTGUID_FIELD_NUMBER = 2;
    private boolean hasDestGuid;
    private java.lang.String destGuid_ = "";
    public boolean hasDestGuid() { return hasDestGuid; }
    public java.lang.String getDestGuid() { return destGuid_; }
    
    // required string relType = 3;
    public static final int RELTYPE_FIELD_NUMBER = 3;
    private boolean hasRelType;
    private java.lang.String relType_ = "";
    public boolean hasRelType() { return hasRelType; }
    public java.lang.String getRelType() { return relType_; }
    
    // repeated .distant.protobuf.Relation.RelationMentionRef mention = 4;
    public static final int MENTION_FIELD_NUMBER = 4;
    private java.util.List<cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef> mention_ =
      java.util.Collections.emptyList();
    public java.util.List<cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef> getMentionList() {
      return mention_;
    }
    public int getMentionCount() { return mention_.size(); }
    public cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef getMention(int index) {
      return mention_.get(index);
    }
    
    private void initFields() {
    }
    public final boolean isInitialized() {
      if (!hasSourceGuid) return false;
      if (!hasDestGuid) return false;
      if (!hasRelType) return false;
      for (cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef element : getMentionList()) {
        if (!element.isInitialized()) return false;
      }
      return true;
    }
    
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (hasSourceGuid()) {
        output.writeString(1, getSourceGuid());
      }
      if (hasDestGuid()) {
        output.writeString(2, getDestGuid());
      }
      if (hasRelType()) {
        output.writeString(3, getRelType());
      }
      for (cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef element : getMentionList()) {
        output.writeMessage(4, element);
      }
      getUnknownFields().writeTo(output);
    }
    
    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;
    
      size = 0;
      if (hasSourceGuid()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(1, getSourceGuid());
      }
      if (hasDestGuid()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(2, getDestGuid());
      }
      if (hasRelType()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(3, getRelType());
      }
      for (cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef element : getMentionList()) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(4, element);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }
    
    public static cc.factorie.protobuf.DocumentProtos.Relation parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Relation parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Relation parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Relation parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Relation parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Relation parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Relation parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static cc.factorie.protobuf.DocumentProtos.Relation parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static cc.factorie.protobuf.DocumentProtos.Relation parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Relation parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }
    
    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(cc.factorie.protobuf.DocumentProtos.Relation prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }
    
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder> {
      private cc.factorie.protobuf.DocumentProtos.Relation result;
      
      // Construct using cc.factorie.protobuf.DocumentProtos.Relation.newBuilder()
      private Builder() {}
      
      private static Builder create() {
        Builder builder = new Builder();
        builder.result = new cc.factorie.protobuf.DocumentProtos.Relation();
        return builder;
      }
      
      protected cc.factorie.protobuf.DocumentProtos.Relation internalGetResult() {
        return result;
      }
      
      public Builder clear() {
        if (result == null) {
          throw new IllegalStateException(
            "Cannot call clear() after build().");
        }
        result = new cc.factorie.protobuf.DocumentProtos.Relation();
        return this;
      }
      
      public Builder clone() {
        return create().mergeFrom(result);
      }
      
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return cc.factorie.protobuf.DocumentProtos.Relation.getDescriptor();
      }
      
      public cc.factorie.protobuf.DocumentProtos.Relation getDefaultInstanceForType() {
        return cc.factorie.protobuf.DocumentProtos.Relation.getDefaultInstance();
      }
      
      public boolean isInitialized() {
        return result.isInitialized();
      }
      public cc.factorie.protobuf.DocumentProtos.Relation build() {
        if (result != null && !isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return buildPartial();
      }
      
      private cc.factorie.protobuf.DocumentProtos.Relation buildParsed()
          throws com.google.protobuf.InvalidProtocolBufferException {
        if (!isInitialized()) {
          throw newUninitializedMessageException(
            result).asInvalidProtocolBufferException();
        }
        return buildPartial();
      }
      
      public cc.factorie.protobuf.DocumentProtos.Relation buildPartial() {
        if (result == null) {
          throw new IllegalStateException(
            "build() has already been called on this Builder.");
        }
        if (result.mention_ != java.util.Collections.EMPTY_LIST) {
          result.mention_ =
            java.util.Collections.unmodifiableList(result.mention_);
        }
        cc.factorie.protobuf.DocumentProtos.Relation returnMe = result;
        result = null;
        return returnMe;
      }
      
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof cc.factorie.protobuf.DocumentProtos.Relation) {
          return mergeFrom((cc.factorie.protobuf.DocumentProtos.Relation)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }
      
      public Builder mergeFrom(cc.factorie.protobuf.DocumentProtos.Relation other) {
        if (other == cc.factorie.protobuf.DocumentProtos.Relation.getDefaultInstance()) return this;
        if (other.hasSourceGuid()) {
          setSourceGuid(other.getSourceGuid());
        }
        if (other.hasDestGuid()) {
          setDestGuid(other.getDestGuid());
        }
        if (other.hasRelType()) {
          setRelType(other.getRelType());
        }
        if (!other.mention_.isEmpty()) {
          if (result.mention_.isEmpty()) {
            result.mention_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef>();
          }
          result.mention_.addAll(other.mention_);
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }
      
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder(
            this.getUnknownFields());
        while (true) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              this.setUnknownFields(unknownFields.build());
              return this;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                this.setUnknownFields(unknownFields.build());
                return this;
              }
              break;
            }
            case 10: {
              setSourceGuid(input.readString());
              break;
            }
            case 18: {
              setDestGuid(input.readString());
              break;
            }
            case 26: {
              setRelType(input.readString());
              break;
            }
            case 34: {
              cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef.Builder subBuilder = cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef.newBuilder();
              input.readMessage(subBuilder, extensionRegistry);
              addMention(subBuilder.buildPartial());
              break;
            }
          }
        }
      }
      
      
      // required string sourceGuid = 1;
      public boolean hasSourceGuid() {
        return result.hasSourceGuid();
      }
      public java.lang.String getSourceGuid() {
        return result.getSourceGuid();
      }
      public Builder setSourceGuid(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasSourceGuid = true;
        result.sourceGuid_ = value;
        return this;
      }
      public Builder clearSourceGuid() {
        result.hasSourceGuid = false;
        result.sourceGuid_ = getDefaultInstance().getSourceGuid();
        return this;
      }
      
      // required string destGuid = 2;
      public boolean hasDestGuid() {
        return result.hasDestGuid();
      }
      public java.lang.String getDestGuid() {
        return result.getDestGuid();
      }
      public Builder setDestGuid(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasDestGuid = true;
        result.destGuid_ = value;
        return this;
      }
      public Builder clearDestGuid() {
        result.hasDestGuid = false;
        result.destGuid_ = getDefaultInstance().getDestGuid();
        return this;
      }
      
      // required string relType = 3;
      public boolean hasRelType() {
        return result.hasRelType();
      }
      public java.lang.String getRelType() {
        return result.getRelType();
      }
      public Builder setRelType(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasRelType = true;
        result.relType_ = value;
        return this;
      }
      public Builder clearRelType() {
        result.hasRelType = false;
        result.relType_ = getDefaultInstance().getRelType();
        return this;
      }
      
      // repeated .distant.protobuf.Relation.RelationMentionRef mention = 4;
      public java.util.List<cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef> getMentionList() {
        return java.util.Collections.unmodifiableList(result.mention_);
      }
      public int getMentionCount() {
        return result.getMentionCount();
      }
      public cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef getMention(int index) {
        return result.getMention(index);
      }
      public Builder setMention(int index, cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef value) {
        if (value == null) {
          throw new NullPointerException();
        }
        result.mention_.set(index, value);
        return this;
      }
      public Builder setMention(int index, cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef.Builder builderForValue) {
        result.mention_.set(index, builderForValue.build());
        return this;
      }
      public Builder addMention(cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef value) {
        if (value == null) {
          throw new NullPointerException();
        }
        if (result.mention_.isEmpty()) {
          result.mention_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef>();
        }
        result.mention_.add(value);
        return this;
      }
      public Builder addMention(cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef.Builder builderForValue) {
        if (result.mention_.isEmpty()) {
          result.mention_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef>();
        }
        result.mention_.add(builderForValue.build());
        return this;
      }
      public Builder addAllMention(
          java.lang.Iterable<? extends cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef> values) {
        if (result.mention_.isEmpty()) {
          result.mention_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef>();
        }
        super.addAll(values, result.mention_);
        return this;
      }
      public Builder clearMention() {
        result.mention_ = java.util.Collections.emptyList();
        return this;
      }
      
      // @@protoc_insertion_point(builder_scope:distant.protobuf.Relation)
    }
    
    static {
      defaultInstance = new Relation(true);
      cc.factorie.protobuf.DocumentProtos.internalForceInit();
      defaultInstance.initFields();
    }
    
    // @@protoc_insertion_point(class_scope:distant.protobuf.Relation)
  }
  
  public static final class Entity extends
      com.google.protobuf.GeneratedMessage {
    // Use Entity.newBuilder() to construct.
    private Entity() {
      initFields();
    }
    private Entity(boolean noInit) {}
    
    private static final Entity defaultInstance;
    public static Entity getDefaultInstance() {
      return defaultInstance;
    }
    
    public Entity getDefaultInstanceForType() {
      return defaultInstance;
    }
    
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Entity_descriptor;
    }
    
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Entity_fieldAccessorTable;
    }
    
    public static final class EntityMentionRef extends
        com.google.protobuf.GeneratedMessage {
      // Use EntityMentionRef.newBuilder() to construct.
      private EntityMentionRef() {
        initFields();
      }
      private EntityMentionRef(boolean noInit) {}
      
      private static final EntityMentionRef defaultInstance;
      public static EntityMentionRef getDefaultInstance() {
        return defaultInstance;
      }
      
      public EntityMentionRef getDefaultInstanceForType() {
        return defaultInstance;
      }
      
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Entity_EntityMentionRef_descriptor;
      }
      
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return cc.factorie.protobuf.DocumentProtos.internal_static_distant_protobuf_Entity_EntityMentionRef_fieldAccessorTable;
      }
      
      // required string filename = 1;
      public static final int FILENAME_FIELD_NUMBER = 1;
      private boolean hasFilename;
      private java.lang.String filename_ = "";
      public boolean hasFilename() { return hasFilename; }
      public java.lang.String getFilename() { return filename_; }
      
      // required int32 id = 2;
      public static final int ID_FIELD_NUMBER = 2;
      private boolean hasId;
      private int id_ = 0;
      public boolean hasId() { return hasId; }
      public int getId() { return id_; }
      
      // repeated string feature = 3;
      public static final int FEATURE_FIELD_NUMBER = 3;
      private java.util.List<java.lang.String> feature_ =
        java.util.Collections.emptyList();
      public java.util.List<java.lang.String> getFeatureList() {
        return feature_;
      }
      public int getFeatureCount() { return feature_.size(); }
      public java.lang.String getFeature(int index) {
        return feature_.get(index);
      }
      
      private void initFields() {
      }
      public final boolean isInitialized() {
        if (!hasFilename) return false;
        if (!hasId) return false;
        return true;
      }
      
      public void writeTo(com.google.protobuf.CodedOutputStream output)
                          throws java.io.IOException {
        getSerializedSize();
        if (hasFilename()) {
          output.writeString(1, getFilename());
        }
        if (hasId()) {
          output.writeInt32(2, getId());
        }
        for (java.lang.String element : getFeatureList()) {
          output.writeString(3, element);
        }
        getUnknownFields().writeTo(output);
      }
      
      private int memoizedSerializedSize = -1;
      public int getSerializedSize() {
        int size = memoizedSerializedSize;
        if (size != -1) return size;
      
        size = 0;
        if (hasFilename()) {
          size += com.google.protobuf.CodedOutputStream
            .computeStringSize(1, getFilename());
        }
        if (hasId()) {
          size += com.google.protobuf.CodedOutputStream
            .computeInt32Size(2, getId());
        }
        {
          int dataSize = 0;
          for (java.lang.String element : getFeatureList()) {
            dataSize += com.google.protobuf.CodedOutputStream
              .computeStringSizeNoTag(element);
          }
          size += dataSize;
          size += 1 * getFeatureList().size();
        }
        size += getUnknownFields().getSerializedSize();
        memoizedSerializedSize = size;
        return size;
      }
      
      public static cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef parseFrom(
          com.google.protobuf.ByteString data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef parseFrom(
          byte[] data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef parseFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef parseDelimitedFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        Builder builder = newBuilder();
        if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
          return builder.buildParsed();
        } else {
          return null;
        }
      }
      public static cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef parseFrom(
          com.google.protobuf.CodedInputStream input)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input).buildParsed();
      }
      public static cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef parseFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return newBuilder().mergeFrom(input, extensionRegistry)
                 .buildParsed();
      }
      
      public static Builder newBuilder() { return Builder.create(); }
      public Builder newBuilderForType() { return newBuilder(); }
      public static Builder newBuilder(cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef prototype) {
        return newBuilder().mergeFrom(prototype);
      }
      public Builder toBuilder() { return newBuilder(this); }
      
      public static final class Builder extends
          com.google.protobuf.GeneratedMessage.Builder<Builder> {
        private cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef result;
        
        // Construct using cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef.newBuilder()
        private Builder() {}
        
        private static Builder create() {
          Builder builder = new Builder();
          builder.result = new cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef();
          return builder;
        }
        
        protected cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef internalGetResult() {
          return result;
        }
        
        public Builder clear() {
          if (result == null) {
            throw new IllegalStateException(
              "Cannot call clear() after build().");
          }
          result = new cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef();
          return this;
        }
        
        public Builder clone() {
          return create().mergeFrom(result);
        }
        
        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef.getDescriptor();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef getDefaultInstanceForType() {
          return cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef.getDefaultInstance();
        }
        
        public boolean isInitialized() {
          return result.isInitialized();
        }
        public cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef build() {
          if (result != null && !isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return buildPartial();
        }
        
        private cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef buildParsed()
            throws com.google.protobuf.InvalidProtocolBufferException {
          if (!isInitialized()) {
            throw newUninitializedMessageException(
              result).asInvalidProtocolBufferException();
          }
          return buildPartial();
        }
        
        public cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef buildPartial() {
          if (result == null) {
            throw new IllegalStateException(
              "build() has already been called on this Builder.");
          }
          if (result.feature_ != java.util.Collections.EMPTY_LIST) {
            result.feature_ =
              java.util.Collections.unmodifiableList(result.feature_);
          }
          cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef returnMe = result;
          result = null;
          return returnMe;
        }
        
        public Builder mergeFrom(com.google.protobuf.Message other) {
          if (other instanceof cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef) {
            return mergeFrom((cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }
        
        public Builder mergeFrom(cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef other) {
          if (other == cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef.getDefaultInstance()) return this;
          if (other.hasFilename()) {
            setFilename(other.getFilename());
          }
          if (other.hasId()) {
            setId(other.getId());
          }
          if (!other.feature_.isEmpty()) {
            if (result.feature_.isEmpty()) {
              result.feature_ = new java.util.ArrayList<java.lang.String>();
            }
            result.feature_.addAll(other.feature_);
          }
          this.mergeUnknownFields(other.getUnknownFields());
          return this;
        }
        
        public Builder mergeFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
          com.google.protobuf.UnknownFieldSet.Builder unknownFields =
            com.google.protobuf.UnknownFieldSet.newBuilder(
              this.getUnknownFields());
          while (true) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                this.setUnknownFields(unknownFields.build());
                return this;
              default: {
                if (!parseUnknownField(input, unknownFields,
                                       extensionRegistry, tag)) {
                  this.setUnknownFields(unknownFields.build());
                  return this;
                }
                break;
              }
              case 10: {
                setFilename(input.readString());
                break;
              }
              case 16: {
                setId(input.readInt32());
                break;
              }
              case 26: {
                addFeature(input.readString());
                break;
              }
            }
          }
        }
        
        
        // required string filename = 1;
        public boolean hasFilename() {
          return result.hasFilename();
        }
        public java.lang.String getFilename() {
          return result.getFilename();
        }
        public Builder setFilename(java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  result.hasFilename = true;
          result.filename_ = value;
          return this;
        }
        public Builder clearFilename() {
          result.hasFilename = false;
          result.filename_ = getDefaultInstance().getFilename();
          return this;
        }
        
        // required int32 id = 2;
        public boolean hasId() {
          return result.hasId();
        }
        public int getId() {
          return result.getId();
        }
        public Builder setId(int value) {
          result.hasId = true;
          result.id_ = value;
          return this;
        }
        public Builder clearId() {
          result.hasId = false;
          result.id_ = 0;
          return this;
        }
        
        // repeated string feature = 3;
        public java.util.List<java.lang.String> getFeatureList() {
          return java.util.Collections.unmodifiableList(result.feature_);
        }
        public int getFeatureCount() {
          return result.getFeatureCount();
        }
        public java.lang.String getFeature(int index) {
          return result.getFeature(index);
        }
        public Builder setFeature(int index, java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  result.feature_.set(index, value);
          return this;
        }
        public Builder addFeature(java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  if (result.feature_.isEmpty()) {
            result.feature_ = new java.util.ArrayList<java.lang.String>();
          }
          result.feature_.add(value);
          return this;
        }
        public Builder addAllFeature(
            java.lang.Iterable<? extends java.lang.String> values) {
          if (result.feature_.isEmpty()) {
            result.feature_ = new java.util.ArrayList<java.lang.String>();
          }
          super.addAll(values, result.feature_);
          return this;
        }
        public Builder clearFeature() {
          result.feature_ = java.util.Collections.emptyList();
          return this;
        }
        
        // @@protoc_insertion_point(builder_scope:distant.protobuf.Entity.EntityMentionRef)
      }
      
      static {
        defaultInstance = new EntityMentionRef(true);
        cc.factorie.protobuf.DocumentProtos.internalForceInit();
        defaultInstance.initFields();
      }
      
      // @@protoc_insertion_point(class_scope:distant.protobuf.Entity.EntityMentionRef)
    }
    
    // required string guid = 1;
    public static final int GUID_FIELD_NUMBER = 1;
    private boolean hasGuid;
    private java.lang.String guid_ = "";
    public boolean hasGuid() { return hasGuid; }
    public java.lang.String getGuid() { return guid_; }
    
    // optional string name = 2;
    public static final int NAME_FIELD_NUMBER = 2;
    private boolean hasName;
    private java.lang.String name_ = "";
    public boolean hasName() { return hasName; }
    public java.lang.String getName() { return name_; }
    
    // optional string type = 3;
    public static final int TYPE_FIELD_NUMBER = 3;
    private boolean hasType;
    private java.lang.String type_ = "";
    public boolean hasType() { return hasType; }
    public java.lang.String getType() { return type_; }
    
    // optional string pred = 4;
    public static final int PRED_FIELD_NUMBER = 4;
    private boolean hasPred;
    private java.lang.String pred_ = "";
    public boolean hasPred() { return hasPred; }
    public java.lang.String getPred() { return pred_; }
    
    // repeated .distant.protobuf.Entity.EntityMentionRef mention = 5;
    public static final int MENTION_FIELD_NUMBER = 5;
    private java.util.List<cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef> mention_ =
      java.util.Collections.emptyList();
    public java.util.List<cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef> getMentionList() {
      return mention_;
    }
    public int getMentionCount() { return mention_.size(); }
    public cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef getMention(int index) {
      return mention_.get(index);
    }
    
    private void initFields() {
    }
    public final boolean isInitialized() {
      if (!hasGuid) return false;
      for (cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef element : getMentionList()) {
        if (!element.isInitialized()) return false;
      }
      return true;
    }
    
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (hasGuid()) {
        output.writeString(1, getGuid());
      }
      if (hasName()) {
        output.writeString(2, getName());
      }
      if (hasType()) {
        output.writeString(3, getType());
      }
      if (hasPred()) {
        output.writeString(4, getPred());
      }
      for (cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef element : getMentionList()) {
        output.writeMessage(5, element);
      }
      getUnknownFields().writeTo(output);
    }
    
    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;
    
      size = 0;
      if (hasGuid()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(1, getGuid());
      }
      if (hasName()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(2, getName());
      }
      if (hasType()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(3, getType());
      }
      if (hasPred()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(4, getPred());
      }
      for (cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef element : getMentionList()) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(5, element);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }
    
    public static cc.factorie.protobuf.DocumentProtos.Entity parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Entity parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Entity parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Entity parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Entity parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Entity parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Entity parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static cc.factorie.protobuf.DocumentProtos.Entity parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static cc.factorie.protobuf.DocumentProtos.Entity parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static cc.factorie.protobuf.DocumentProtos.Entity parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }
    
    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(cc.factorie.protobuf.DocumentProtos.Entity prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }
    
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder> {
      private cc.factorie.protobuf.DocumentProtos.Entity result;
      
      // Construct using cc.factorie.protobuf.DocumentProtos.Entity.newBuilder()
      private Builder() {}
      
      private static Builder create() {
        Builder builder = new Builder();
        builder.result = new cc.factorie.protobuf.DocumentProtos.Entity();
        return builder;
      }
      
      protected cc.factorie.protobuf.DocumentProtos.Entity internalGetResult() {
        return result;
      }
      
      public Builder clear() {
        if (result == null) {
          throw new IllegalStateException(
            "Cannot call clear() after build().");
        }
        result = new cc.factorie.protobuf.DocumentProtos.Entity();
        return this;
      }
      
      public Builder clone() {
        return create().mergeFrom(result);
      }
      
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return cc.factorie.protobuf.DocumentProtos.Entity.getDescriptor();
      }
      
      public cc.factorie.protobuf.DocumentProtos.Entity getDefaultInstanceForType() {
        return cc.factorie.protobuf.DocumentProtos.Entity.getDefaultInstance();
      }
      
      public boolean isInitialized() {
        return result.isInitialized();
      }
      public cc.factorie.protobuf.DocumentProtos.Entity build() {
        if (result != null && !isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return buildPartial();
      }
      
      private cc.factorie.protobuf.DocumentProtos.Entity buildParsed()
          throws com.google.protobuf.InvalidProtocolBufferException {
        if (!isInitialized()) {
          throw newUninitializedMessageException(
            result).asInvalidProtocolBufferException();
        }
        return buildPartial();
      }
      
      public cc.factorie.protobuf.DocumentProtos.Entity buildPartial() {
        if (result == null) {
          throw new IllegalStateException(
            "build() has already been called on this Builder.");
        }
        if (result.mention_ != java.util.Collections.EMPTY_LIST) {
          result.mention_ =
            java.util.Collections.unmodifiableList(result.mention_);
        }
        cc.factorie.protobuf.DocumentProtos.Entity returnMe = result;
        result = null;
        return returnMe;
      }
      
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof cc.factorie.protobuf.DocumentProtos.Entity) {
          return mergeFrom((cc.factorie.protobuf.DocumentProtos.Entity)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }
      
      public Builder mergeFrom(cc.factorie.protobuf.DocumentProtos.Entity other) {
        if (other == cc.factorie.protobuf.DocumentProtos.Entity.getDefaultInstance()) return this;
        if (other.hasGuid()) {
          setGuid(other.getGuid());
        }
        if (other.hasName()) {
          setName(other.getName());
        }
        if (other.hasType()) {
          setType(other.getType());
        }
        if (other.hasPred()) {
          setPred(other.getPred());
        }
        if (!other.mention_.isEmpty()) {
          if (result.mention_.isEmpty()) {
            result.mention_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef>();
          }
          result.mention_.addAll(other.mention_);
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }
      
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder(
            this.getUnknownFields());
        while (true) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              this.setUnknownFields(unknownFields.build());
              return this;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                this.setUnknownFields(unknownFields.build());
                return this;
              }
              break;
            }
            case 10: {
              setGuid(input.readString());
              break;
            }
            case 18: {
              setName(input.readString());
              break;
            }
            case 26: {
              setType(input.readString());
              break;
            }
            case 34: {
              setPred(input.readString());
              break;
            }
            case 42: {
              cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef.Builder subBuilder = cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef.newBuilder();
              input.readMessage(subBuilder, extensionRegistry);
              addMention(subBuilder.buildPartial());
              break;
            }
          }
        }
      }
      
      
      // required string guid = 1;
      public boolean hasGuid() {
        return result.hasGuid();
      }
      public java.lang.String getGuid() {
        return result.getGuid();
      }
      public Builder setGuid(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasGuid = true;
        result.guid_ = value;
        return this;
      }
      public Builder clearGuid() {
        result.hasGuid = false;
        result.guid_ = getDefaultInstance().getGuid();
        return this;
      }
      
      // optional string name = 2;
      public boolean hasName() {
        return result.hasName();
      }
      public java.lang.String getName() {
        return result.getName();
      }
      public Builder setName(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasName = true;
        result.name_ = value;
        return this;
      }
      public Builder clearName() {
        result.hasName = false;
        result.name_ = getDefaultInstance().getName();
        return this;
      }
      
      // optional string type = 3;
      public boolean hasType() {
        return result.hasType();
      }
      public java.lang.String getType() {
        return result.getType();
      }
      public Builder setType(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasType = true;
        result.type_ = value;
        return this;
      }
      public Builder clearType() {
        result.hasType = false;
        result.type_ = getDefaultInstance().getType();
        return this;
      }
      
      // optional string pred = 4;
      public boolean hasPred() {
        return result.hasPred();
      }
      public java.lang.String getPred() {
        return result.getPred();
      }
      public Builder setPred(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasPred = true;
        result.pred_ = value;
        return this;
      }
      public Builder clearPred() {
        result.hasPred = false;
        result.pred_ = getDefaultInstance().getPred();
        return this;
      }
      
      // repeated .distant.protobuf.Entity.EntityMentionRef mention = 5;
      public java.util.List<cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef> getMentionList() {
        return java.util.Collections.unmodifiableList(result.mention_);
      }
      public int getMentionCount() {
        return result.getMentionCount();
      }
      public cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef getMention(int index) {
        return result.getMention(index);
      }
      public Builder setMention(int index, cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef value) {
        if (value == null) {
          throw new NullPointerException();
        }
        result.mention_.set(index, value);
        return this;
      }
      public Builder setMention(int index, cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef.Builder builderForValue) {
        result.mention_.set(index, builderForValue.build());
        return this;
      }
      public Builder addMention(cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef value) {
        if (value == null) {
          throw new NullPointerException();
        }
        if (result.mention_.isEmpty()) {
          result.mention_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef>();
        }
        result.mention_.add(value);
        return this;
      }
      public Builder addMention(cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef.Builder builderForValue) {
        if (result.mention_.isEmpty()) {
          result.mention_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef>();
        }
        result.mention_.add(builderForValue.build());
        return this;
      }
      public Builder addAllMention(
          java.lang.Iterable<? extends cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef> values) {
        if (result.mention_.isEmpty()) {
          result.mention_ = new java.util.ArrayList<cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef>();
        }
        super.addAll(values, result.mention_);
        return this;
      }
      public Builder clearMention() {
        result.mention_ = java.util.Collections.emptyList();
        return this;
      }
      
      // @@protoc_insertion_point(builder_scope:distant.protobuf.Entity)
    }
    
    static {
      defaultInstance = new Entity(true);
      cc.factorie.protobuf.DocumentProtos.internalForceInit();
      defaultInstance.initFields();
    }
    
    // @@protoc_insertion_point(class_scope:distant.protobuf.Entity)
  }
  
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_distant_protobuf_Document_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_distant_protobuf_Document_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_distant_protobuf_Document_Sentence_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_distant_protobuf_Document_Sentence_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_distant_protobuf_Document_Token_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_distant_protobuf_Document_Token_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_distant_protobuf_Document_Mention_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_distant_protobuf_Document_Mention_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_distant_protobuf_Document_DepTree_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_distant_protobuf_Document_DepTree_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_distant_protobuf_Document_RelationMention_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_distant_protobuf_Document_RelationMention_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_distant_protobuf_Relation_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_distant_protobuf_Relation_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_distant_protobuf_Relation_RelationMentionRef_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_distant_protobuf_Relation_RelationMentionRef_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_distant_protobuf_Entity_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_distant_protobuf_Entity_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_distant_protobuf_Entity_EntityMentionRef_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_distant_protobuf_Entity_EntityMentionRef_fieldAccessorTable;
  
  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n\016Document.proto\022\020distant.protobuf\"\207\004\n\010D" +
      "ocument\022\020\n\010filename\030\001 \002(\t\0226\n\tsentences\030\002" +
      " \003(\0132#.distant.protobuf.Document.Sentenc" +
      "e\032\247\001\n\010Sentence\0220\n\006tokens\030\001 \003(\0132 .distant" +
      ".protobuf.Document.Token\0224\n\010mentions\030\002 \003" +
      "(\0132\".distant.protobuf.Document.Mention\0223" +
      "\n\007depTree\030\003 \001(\0132\".distant.protobuf.Docum" +
      "ent.DepTree\032/\n\005Token\022\014\n\004word\030\001 \002(\t\022\013\n\003ta" +
      "g\030\002 \001(\t\022\013\n\003ner\030\003 \001(\t\032R\n\007Mention\022\n\n\002id\030\001 " +
      "\002(\005\022\022\n\nentityGuid\030\002 \001(\t\022\014\n\004from\030\003 \002(\005\022\n\n",
      "\002to\030\004 \002(\005\022\r\n\005label\030\005 \002(\t\0326\n\007DepTree\022\014\n\004r" +
      "oot\030\001 \002(\005\022\014\n\004head\030\002 \003(\005\022\017\n\007relType\030\003 \003(\t" +
      "\032J\n\017RelationMention\022\n\n\002id\030\001 \002(\005\022\016\n\006sourc" +
      "e\030\002 \002(\005\022\014\n\004dest\030\003 \002(\005\022\r\n\005label\030\004 \002(\t\"\356\001\n" +
      "\010Relation\022\022\n\nsourceGuid\030\001 \002(\t\022\020\n\010destGui" +
      "d\030\002 \002(\t\022\017\n\007relType\030\003 \002(\t\022>\n\007mention\030\004 \003(" +
      "\0132-.distant.protobuf.Relation.RelationMe" +
      "ntionRef\032k\n\022RelationMentionRef\022\020\n\010filena" +
      "me\030\001 \002(\t\022\020\n\010sourceId\030\002 \002(\005\022\016\n\006destId\030\003 \002" +
      "(\005\022\017\n\007feature\030\004 \003(\t\022\020\n\010sentence\030\005 \001(\t\"\277\001",
      "\n\006Entity\022\014\n\004guid\030\001 \002(\t\022\014\n\004name\030\002 \001(\t\022\014\n\004" +
      "type\030\003 \001(\t\022\014\n\004pred\030\004 \001(\t\022:\n\007mention\030\005 \003(" +
      "\0132).distant.protobuf.Entity.EntityMentio" +
      "nRef\032A\n\020EntityMentionRef\022\020\n\010filename\030\001 \002" +
      "(\t\022\n\n\002id\030\002 \002(\005\022\017\n\007feature\030\003 \003(\tB&\n\024cc.fa" +
      "ctorie.protobufB\016DocumentProtos"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
      new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
        public com.google.protobuf.ExtensionRegistry assignDescriptors(
            com.google.protobuf.Descriptors.FileDescriptor root) {
          descriptor = root;
          internal_static_distant_protobuf_Document_descriptor =
            getDescriptor().getMessageTypes().get(0);
          internal_static_distant_protobuf_Document_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_distant_protobuf_Document_descriptor,
              new java.lang.String[] { "Filename", "Sentences", },
              cc.factorie.protobuf.DocumentProtos.Document.class,
              cc.factorie.protobuf.DocumentProtos.Document.Builder.class);
          internal_static_distant_protobuf_Document_Sentence_descriptor =
            internal_static_distant_protobuf_Document_descriptor.getNestedTypes().get(0);
          internal_static_distant_protobuf_Document_Sentence_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_distant_protobuf_Document_Sentence_descriptor,
              new java.lang.String[] { "Tokens", "Mentions", "DepTree", },
              cc.factorie.protobuf.DocumentProtos.Document.Sentence.class,
              cc.factorie.protobuf.DocumentProtos.Document.Sentence.Builder.class);
          internal_static_distant_protobuf_Document_Token_descriptor =
            internal_static_distant_protobuf_Document_descriptor.getNestedTypes().get(1);
          internal_static_distant_protobuf_Document_Token_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_distant_protobuf_Document_Token_descriptor,
              new java.lang.String[] { "Word", "Tag", "Ner", },
              cc.factorie.protobuf.DocumentProtos.Document.Token.class,
              cc.factorie.protobuf.DocumentProtos.Document.Token.Builder.class);
          internal_static_distant_protobuf_Document_Mention_descriptor =
            internal_static_distant_protobuf_Document_descriptor.getNestedTypes().get(2);
          internal_static_distant_protobuf_Document_Mention_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_distant_protobuf_Document_Mention_descriptor,
              new java.lang.String[] { "Id", "EntityGuid", "From", "To", "Label", },
              cc.factorie.protobuf.DocumentProtos.Document.Mention.class,
              cc.factorie.protobuf.DocumentProtos.Document.Mention.Builder.class);
          internal_static_distant_protobuf_Document_DepTree_descriptor =
            internal_static_distant_protobuf_Document_descriptor.getNestedTypes().get(3);
          internal_static_distant_protobuf_Document_DepTree_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_distant_protobuf_Document_DepTree_descriptor,
              new java.lang.String[] { "Root", "Head", "RelType", },
              cc.factorie.protobuf.DocumentProtos.Document.DepTree.class,
              cc.factorie.protobuf.DocumentProtos.Document.DepTree.Builder.class);
          internal_static_distant_protobuf_Document_RelationMention_descriptor =
            internal_static_distant_protobuf_Document_descriptor.getNestedTypes().get(4);
          internal_static_distant_protobuf_Document_RelationMention_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_distant_protobuf_Document_RelationMention_descriptor,
              new java.lang.String[] { "Id", "Source", "Dest", "Label", },
              cc.factorie.protobuf.DocumentProtos.Document.RelationMention.class,
              cc.factorie.protobuf.DocumentProtos.Document.RelationMention.Builder.class);
          internal_static_distant_protobuf_Relation_descriptor =
            getDescriptor().getMessageTypes().get(1);
          internal_static_distant_protobuf_Relation_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_distant_protobuf_Relation_descriptor,
              new java.lang.String[] { "SourceGuid", "DestGuid", "RelType", "Mention", },
              cc.factorie.protobuf.DocumentProtos.Relation.class,
              cc.factorie.protobuf.DocumentProtos.Relation.Builder.class);
          internal_static_distant_protobuf_Relation_RelationMentionRef_descriptor =
            internal_static_distant_protobuf_Relation_descriptor.getNestedTypes().get(0);
          internal_static_distant_protobuf_Relation_RelationMentionRef_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_distant_protobuf_Relation_RelationMentionRef_descriptor,
              new java.lang.String[] { "Filename", "SourceId", "DestId", "Feature", "Sentence", },
              cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef.class,
              cc.factorie.protobuf.DocumentProtos.Relation.RelationMentionRef.Builder.class);
          internal_static_distant_protobuf_Entity_descriptor =
            getDescriptor().getMessageTypes().get(2);
          internal_static_distant_protobuf_Entity_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_distant_protobuf_Entity_descriptor,
              new java.lang.String[] { "Guid", "Name", "Type", "Pred", "Mention", },
              cc.factorie.protobuf.DocumentProtos.Entity.class,
              cc.factorie.protobuf.DocumentProtos.Entity.Builder.class);
          internal_static_distant_protobuf_Entity_EntityMentionRef_descriptor =
            internal_static_distant_protobuf_Entity_descriptor.getNestedTypes().get(0);
          internal_static_distant_protobuf_Entity_EntityMentionRef_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_distant_protobuf_Entity_EntityMentionRef_descriptor,
              new java.lang.String[] { "Filename", "Id", "Feature", },
              cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef.class,
              cc.factorie.protobuf.DocumentProtos.Entity.EntityMentionRef.Builder.class);
          return null;
        }
      };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
        }, assigner);
  }
  
  public static void internalForceInit() {}
  
  // @@protoc_insertion_point(outer_class_scope)
}
