Skip to content
Snippets Groups Projects
Select Git revision
  • a23f7bdffe4e24538f1303bdbbebd8989aafcc0e
  • master default protected
  • vertical_relations
  • lu_without_semantic_frames
  • hierarchy
  • additional-unification-filters
  • v0.1.1
  • v0.1.0
  • v0.0.9
  • v0.0.8
  • v0.0.7
  • v0.0.6
  • v0.0.5
  • v0.0.4
  • v0.0.3
  • v0.0.2
  • v0.0.1
17 results

checkboxselectmultiple_with_tooltips.html

Blame
  • getorth.cpp 1.47 KiB
    /*
        Copyright (C) 2011 Adam Wardyński, Tomasz Śniatowski, Paweł Kędzia,
        Adam Radziszewski, Bartosz Broda
        Part of the WCCL project
    
        This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the Free
    Software Foundation; either version 3 of the License, or (at your option)
    any later version.
    
        This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    or FITNESS FOR A PARTICULAR PURPOSE. 
    
        See the LICENSE and COPYING files for more details.
    */
    
    #include <libwccl/ops/functions/strset/getorth.h>
    #include <libwccl/ops/formatters.h>
    #include <libwccl/ops/functions/constant.h>
    
    namespace Wccl {
    
    std::string GetOrth::to_string(const Corpus2::Tagset& tagset) const
    {
    	return UnaryFunctionFormatter::to_string(tagset, *this, *pos_expr_, "[", "]");
    }
    
    std::ostream& GetOrth::write_to(std::ostream& os) const
    {
    	return os << raw_name() << "[" << *pos_expr_ << "]";
    }
    
    GetOrth::BaseRetValPtr GetOrth::apply_internal(const FunExecContext& context) const
    {
    	const boost::shared_ptr<const Position>& pos = pos_expr_->apply(context);
    	const SentenceContext& sc = context.sentence_context();
    	if (sc.is_outside(*pos)) {
    		return detail::DefaultFunction<StrSet>()->apply(context);
    	}
    	boost::shared_ptr<StrSet> u_set = boost::make_shared<StrSet>();
    	u_set->insert(sc.at(*pos)->orth());
    	return u_set;
    }
    
    } /* end ns Wccl */