public Query(DVModelReranker _enclosing)
 {
     this._enclosing  = _enclosing;
     this.transformer = LexicalizedParser.BuildTrainTransformer(this._enclosing.op);
     this.scorer      = new DVParserCostAndGradient(null, null, this._enclosing.model, this._enclosing.op);
     this.deepTrees   = Generics.NewArrayList();
 }
        public virtual LexicalizedParser AttachModelToLexicalizedParser()
        {
            LexicalizedParser newParser = LexicalizedParser.CopyLexicalizedParser(parser);
            DVModelReranker   reranker  = new DVModelReranker(dvModel);

            newParser.reranker = reranker;
            return(newParser);
        }
        public static DVModel GetModelFromLexicalizedParser(LexicalizedParser parser)
        {
            if (!(parser.reranker is DVModelReranker))
            {
                throw new ArgumentException("This parser does not contain a DVModel reranker");
            }
            DVModelReranker reranker = (DVModelReranker)parser.reranker;

            return(reranker.GetModel());
        }