<?php

/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.7
 *
 * This file is not intended to be easily readable and contains a number of
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG
 * interface file instead.
 * ----------------------------------------------------------------------------- */

// Try to load our extension if it's not already loaded.
if (!extension_loaded('strus')) {
  if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
    if (!dl('php_strus.dll')) return;
  } else {
    // PHP_SHLIB_SUFFIX gives 'dylib' on MacOS X but modules are 'so'.
    if (PHP_SHLIB_SUFFIX === 'dylib') {
      if (!dl('strus.so')) return;
    } else {
      if (!dl('strus.'.PHP_SHLIB_SUFFIX)) return;
    }
  }
}



abstract class strus {
	const Variant_UNDEFINED = 0;

	const Variant_UINT = Variant_UINT;

	const Variant_INT = Variant_INT;

	const Variant_FLOAT = Variant_FLOAT;

	const Variant_TEXT = Variant_TEXT;
}

/* PHP Proxy Classes */
class StringVector {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($n=null) {
		if (is_resource($n) && get_resource_type($n) === '_p_std__vectorT_std__string_t') {
			$this->_cPtr=$n;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StringVector(); break;
		default: $this->_cPtr=new_StringVector($n);
		}
	}

	function size() {
		return StringVector_size($this->_cPtr);
	}

	function capacity() {
		return StringVector_capacity($this->_cPtr);
	}

	function reserve($n) {
		StringVector_reserve($this->_cPtr,$n);
	}

	function clear() {
		StringVector_clear($this->_cPtr);
	}

	function push($x) {
		StringVector_push($this->_cPtr,$x);
	}

	function is_empty() {
		return StringVector_is_empty($this->_cPtr);
	}

	function pop() {
		return StringVector_pop($this->_cPtr);
	}

	function get($i) {
		return StringVector_get($this->_cPtr,$i);
	}

	function set($i,$val) {
		StringVector_set($this->_cPtr,$i,$val);
	}
}

class IntVector {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($n=null) {
		if (is_resource($n) && get_resource_type($n) === '_p_std__vectorT_int_t') {
			$this->_cPtr=$n;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_IntVector(); break;
		default: $this->_cPtr=new_IntVector($n);
		}
	}

	function size() {
		return IntVector_size($this->_cPtr);
	}

	function capacity() {
		return IntVector_capacity($this->_cPtr);
	}

	function reserve($n) {
		IntVector_reserve($this->_cPtr,$n);
	}

	function clear() {
		IntVector_clear($this->_cPtr);
	}

	function push($x) {
		IntVector_push($this->_cPtr,$x);
	}

	function is_empty() {
		return IntVector_is_empty($this->_cPtr);
	}

	function pop() {
		return IntVector_pop($this->_cPtr);
	}

	function get($i) {
		return IntVector_get($this->_cPtr,$i);
	}

	function set($i,$val) {
		IntVector_set($this->_cPtr,$i,$val);
	}
}

class TermVector {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($n=null) {
		if (is_resource($n) && get_resource_type($n) === '_p_std__vectorT_Term_t') {
			$this->_cPtr=$n;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_TermVector(); break;
		default: $this->_cPtr=new_TermVector($n);
		}
	}

	function size() {
		return TermVector_size($this->_cPtr);
	}

	function capacity() {
		return TermVector_capacity($this->_cPtr);
	}

	function reserve($n) {
		TermVector_reserve($this->_cPtr,$n);
	}

	function clear() {
		TermVector_clear($this->_cPtr);
	}

	function push($x) {
		TermVector_push($this->_cPtr,$x);
	}

	function is_empty() {
		return TermVector_is_empty($this->_cPtr);
	}

	function pop() {
		$r=TermVector_pop($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusTerm($r);
		}
		return $r;
	}

	function get($i) {
		$r=TermVector_get($this->_cPtr,$i);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusTerm($r);
		}
		return $r;
	}

	function set($i,$val) {
		TermVector_set($this->_cPtr,$i,$val);
	}
}

class RankVector {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($n=null) {
		if (is_resource($n) && get_resource_type($n) === '_p_std__vectorT_Rank_t') {
			$this->_cPtr=$n;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_RankVector(); break;
		default: $this->_cPtr=new_RankVector($n);
		}
	}

	function size() {
		return RankVector_size($this->_cPtr);
	}

	function capacity() {
		return RankVector_capacity($this->_cPtr);
	}

	function reserve($n) {
		RankVector_reserve($this->_cPtr,$n);
	}

	function clear() {
		RankVector_clear($this->_cPtr);
	}

	function push($x) {
		RankVector_push($this->_cPtr,$x);
	}

	function is_empty() {
		return RankVector_is_empty($this->_cPtr);
	}

	function pop() {
		$r=RankVector_pop($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusRank($r);
		}
		return $r;
	}

	function get($i) {
		$r=RankVector_get($this->_cPtr,$i);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusRank($r);
		}
		return $r;
	}

	function set($i,$val) {
		RankVector_set($this->_cPtr,$i,$val);
	}
}

class StrusTokenizer {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o_or_name_=null,$arg__or_arg1_=null,$arg2_=null) {
		if (is_resource($o_or_name_) && get_resource_type($o_or_name_) === '_p_Tokenizer') {
			$this->_cPtr=$o_or_name_;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusTokenizer(); break;
		case 1: $this->_cPtr=new_StrusTokenizer($o_or_name_); break;
		case 2: $this->_cPtr=new_StrusTokenizer($o_or_name_,$arg__or_arg1_); break;
		default: $this->_cPtr=new_StrusTokenizer($o_or_name_,$arg__or_arg1_,$arg2_);
		}
	}

	function name() {
		return StrusTokenizer_name($this->_cPtr);
	}

	function arguments() {
		$r=StrusTokenizer_arguments($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StringVector($r);
		}
		return $r;
	}

	function setName($name_) {
		StrusTokenizer_setName($this->_cPtr,$name_);
	}

	function addArgument($arg_) {
		StrusTokenizer_addArgument($this->_cPtr,$arg_);
	}

	function addArgumentInt($arg_) {
		StrusTokenizer_addArgumentInt($this->_cPtr,$arg_);
	}

	function addArgumentFloat($arg_) {
		StrusTokenizer_addArgumentFloat($this->_cPtr,$arg_);
	}
}

class StrusNormalizer {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o_or_name_=null,$arg__or_arg1_=null,$arg2_=null) {
		if (is_resource($o_or_name_) && get_resource_type($o_or_name_) === '_p_Normalizer') {
			$this->_cPtr=$o_or_name_;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusNormalizer(); break;
		case 1: $this->_cPtr=new_StrusNormalizer($o_or_name_); break;
		case 2: $this->_cPtr=new_StrusNormalizer($o_or_name_,$arg__or_arg1_); break;
		default: $this->_cPtr=new_StrusNormalizer($o_or_name_,$arg__or_arg1_,$arg2_);
		}
	}

	function name() {
		return StrusNormalizer_name($this->_cPtr);
	}

	function arguments() {
		$r=StrusNormalizer_arguments($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StringVector($r);
		}
		return $r;
	}

	function setName($name_) {
		StrusNormalizer_setName($this->_cPtr,$name_);
	}

	function addArgument($arg_) {
		StrusNormalizer_addArgument($this->_cPtr,$arg_);
	}

	function addArgumentInt($arg_) {
		StrusNormalizer_addArgumentInt($this->_cPtr,$arg_);
	}

	function addArgumentFloat($arg_) {
		StrusNormalizer_addArgumentFloat($this->_cPtr,$arg_);
	}
}

class StrusAggregator {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o_or_name_=null,$arg__or_arg1_=null,$arg2_=null) {
		if (is_resource($o_or_name_) && get_resource_type($o_or_name_) === '_p_Aggregator') {
			$this->_cPtr=$o_or_name_;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusAggregator(); break;
		case 1: $this->_cPtr=new_StrusAggregator($o_or_name_); break;
		case 2: $this->_cPtr=new_StrusAggregator($o_or_name_,$arg__or_arg1_); break;
		default: $this->_cPtr=new_StrusAggregator($o_or_name_,$arg__or_arg1_,$arg2_);
		}
	}

	function name() {
		return StrusAggregator_name($this->_cPtr);
	}

	function arguments() {
		$r=StrusAggregator_arguments($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StringVector($r);
		}
		return $r;
	}

	function setName($name_) {
		StrusAggregator_setName($this->_cPtr,$name_);
	}

	function addArgument($arg_) {
		StrusAggregator_addArgument($this->_cPtr,$arg_);
	}

	function addArgumentInt($arg_) {
		StrusAggregator_addArgumentInt($this->_cPtr,$arg_);
	}

	function addArgumentFloat($arg_) {
		StrusAggregator_addArgumentFloat($this->_cPtr,$arg_);
	}
}

class VariantValue {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		$func = 'VariantValue_'.$var.'_set';
		if (function_exists($func)) return call_user_func($func,$this->_cPtr,$value);
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		$func = 'VariantValue_'.$var.'_get';
		if (function_exists($func)) return call_user_func($func,$this->_cPtr);
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if (function_exists('VariantValue_'.$var.'_get')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_VariantValue') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_VariantValue();
	}
}

class StrusVariant {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o_or_v=null) {
		if (is_resource($o_or_v) && get_resource_type($o_or_v) === '_p_Variant') {
			$this->_cPtr=$o_or_v;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusVariant(); break;
		default: $this->_cPtr=new_StrusVariant($o_or_v);
		}
	}

	function defined() {
		return StrusVariant_defined($this->_cPtr);
	}

	function type() {
		return StrusVariant_type($this->_cPtr);
	}

	function getUInt() {
		return StrusVariant_getUInt($this->_cPtr);
	}

	function getInt() {
		return StrusVariant_getInt($this->_cPtr);
	}

	function getFloat() {
		return StrusVariant_getFloat($this->_cPtr);
	}

	function getText() {
		return StrusVariant_getText($this->_cPtr);
	}

	function init() {
		StrusVariant_init($this->_cPtr);
	}

	function assign($o) {
		StrusVariant_assign($this->_cPtr,$o);
	}

	function assignUint($v) {
		StrusVariant_assignUint($this->_cPtr,$v);
	}

	function assignInt($v) {
		StrusVariant_assignInt($this->_cPtr,$v);
	}

	function assignFloat($v) {
		StrusVariant_assignFloat($this->_cPtr,$v);
	}

	function assignText($v) {
		StrusVariant_assignText($this->_cPtr,$v);
	}

	function assign_operator($o) {
		$r=StrusVariant_assign_operator($this->_cPtr,$o);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusVariant($r);
		}
		return $r;
	}
}

class StrusTerm {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($type__or_o=null,$value_=null,$position_=null) {
		if (is_resource($type__or_o) && get_resource_type($type__or_o) === '_p_Term') {
			$this->_cPtr=$type__or_o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusTerm(); break;
		case 1: $this->_cPtr=new_StrusTerm($type__or_o); break;
		case 2: $this->_cPtr=new_StrusTerm($type__or_o,$value_); break;
		default: $this->_cPtr=new_StrusTerm($type__or_o,$value_,$position_);
		}
	}

	function type() {
		return StrusTerm_type($this->_cPtr);
	}

	function value() {
		return StrusTerm_value($this->_cPtr);
	}

	function position() {
		return StrusTerm_position($this->_cPtr);
	}
}

class StrusMetaData {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($name__or_o=null,$value_=null) {
		if (is_resource($name__or_o) && get_resource_type($name__or_o) === '_p_MetaData') {
			$this->_cPtr=$name__or_o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusMetaData(); break;
		case 1: $this->_cPtr=new_StrusMetaData($name__or_o); break;
		default: $this->_cPtr=new_StrusMetaData($name__or_o,$value_);
		}
	}

	function name() {
		return StrusMetaData_name($this->_cPtr);
	}

	function value() {
		return StrusMetaData_value($this->_cPtr);
	}
}

class StrusAttribute {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($name__or_o=null,$value_=null) {
		if (is_resource($name__or_o) && get_resource_type($name__or_o) === '_p_Attribute') {
			$this->_cPtr=$name__or_o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusAttribute(); break;
		case 1: $this->_cPtr=new_StrusAttribute($name__or_o); break;
		default: $this->_cPtr=new_StrusAttribute($name__or_o,$value_);
		}
	}

	function name() {
		return StrusAttribute_name($this->_cPtr);
	}

	function value() {
		return StrusAttribute_value($this->_cPtr);
	}
}

class StrusDocumentClass {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($mimeType__or_o=null,$encoding_=null,$scheme_=null) {
		if (is_resource($mimeType__or_o) && get_resource_type($mimeType__or_o) === '_p_DocumentClass') {
			$this->_cPtr=$mimeType__or_o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusDocumentClass(); break;
		case 1: $this->_cPtr=new_StrusDocumentClass($mimeType__or_o); break;
		case 2: $this->_cPtr=new_StrusDocumentClass($mimeType__or_o,$encoding_); break;
		default: $this->_cPtr=new_StrusDocumentClass($mimeType__or_o,$encoding_,$scheme_);
		}
	}

	function valid() {
		return StrusDocumentClass_valid($this->_cPtr);
	}

	function setMimeType($mimeType_) {
		StrusDocumentClass_setMimeType($this->_cPtr,$mimeType_);
	}

	function setScheme($scheme_) {
		StrusDocumentClass_setScheme($this->_cPtr,$scheme_);
	}

	function setEncoding($encoding_) {
		StrusDocumentClass_setEncoding($this->_cPtr,$encoding_);
	}

	function mimeType() {
		return StrusDocumentClass_mimeType($this->_cPtr);
	}

	function scheme() {
		return StrusDocumentClass_scheme($this->_cPtr);
	}

	function encoding() {
		return StrusDocumentClass_encoding($this->_cPtr);
	}
}

class StrusDocument {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o=null) {
		if (is_resource($o) && get_resource_type($o) === '_p_Document') {
			$this->_cPtr=$o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusDocument(); break;
		default: $this->_cPtr=new_StrusDocument($o);
		}
	}

	function addSearchIndexTerm($type,$value,$position) {
		StrusDocument_addSearchIndexTerm($this->_cPtr,$type,$value,$position);
	}

	function addForwardIndexTerm($type,$value,$position) {
		StrusDocument_addForwardIndexTerm($this->_cPtr,$type,$value,$position);
	}

	function setMetaData($name,$value) {
		StrusDocument_setMetaData($this->_cPtr,$name,$value);
	}

	function setAttribute($name,$value) {
		StrusDocument_setAttribute($this->_cPtr,$name,$value);
	}

	function setUserAccessRight($username) {
		StrusDocument_setUserAccessRight($this->_cPtr,$username);
	}

	function setDocid($docid_) {
		StrusDocument_setDocid($this->_cPtr,$docid_);
	}

	function searchIndexTerms() {
		$r=StrusDocument_searchIndexTerms($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new TermVector($r);
		}
		return $r;
	}

	function forwardIndexTerms() {
		$r=StrusDocument_forwardIndexTerms($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new TermVector($r);
		}
		return $r;
	}

	function metaData() {
		return StrusDocument_metaData($this->_cPtr);
	}

	function attributes() {
		return StrusDocument_attributes($this->_cPtr);
	}

	function users() {
		$r=StrusDocument_users($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StringVector($r);
		}
		return $r;
	}

	function docid() {
		return StrusDocument_docid($this->_cPtr);
	}
}

class StrusDocumentAnalyzer {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o) {
		if (is_resource($o) && get_resource_type($o) === '_p_DocumentAnalyzer') {
			$this->_cPtr=$o;
			return;
		}
		$this->_cPtr=new_StrusDocumentAnalyzer($o);
	}

	function addSearchIndexFeature($type,$selectexpr,$tokenizer,$normalizers,$options) {
		StrusDocumentAnalyzer_addSearchIndexFeature($this->_cPtr,$type,$selectexpr,$tokenizer,$normalizers,$options);
	}

	function addForwardIndexFeature($type,$selectexpr,$tokenizer,$normalizers,$options) {
		StrusDocumentAnalyzer_addForwardIndexFeature($this->_cPtr,$type,$selectexpr,$tokenizer,$normalizers,$options);
	}

	function defineMetaData($fieldname,$selectexpr,$tokenizer,$normalizers) {
		StrusDocumentAnalyzer_defineMetaData($this->_cPtr,$fieldname,$selectexpr,$tokenizer,$normalizers);
	}

	function defineAggregatedMetaData($fieldname,$function) {
		StrusDocumentAnalyzer_defineAggregatedMetaData($this->_cPtr,$fieldname,$function);
	}

	function defineAttribute($attribname,$selectexpr,$tokenizer,$normalizers) {
		StrusDocumentAnalyzer_defineAttribute($this->_cPtr,$attribname,$selectexpr,$tokenizer,$normalizers);
	}

	function defineDocument($subDocumentTypeName,$selectexpr) {
		StrusDocumentAnalyzer_defineDocument($this->_cPtr,$subDocumentTypeName,$selectexpr);
	}

	function analyze($content,$dclass=null) {
		switch (func_num_args()) {
		case 1: $r=StrusDocumentAnalyzer_analyze($this->_cPtr,$content); break;
		default: $r=StrusDocumentAnalyzer_analyze($this->_cPtr,$content,$dclass);
		}
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusDocument($r);
		}
		return $r;
	}

	function createQueue() {
		$r=StrusDocumentAnalyzer_createQueue($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new DocumentAnalyzeQueue($r);
		}
		return $r;
	}
}

class DocumentAnalyzeQueue {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o) {
		if (is_resource($o) && get_resource_type($o) === '_p_DocumentAnalyzeQueue') {
			$this->_cPtr=$o;
			return;
		}
		$this->_cPtr=new_DocumentAnalyzeQueue($o);
	}

	function push($content,$dclass=null) {
		switch (func_num_args()) {
		case 1: DocumentAnalyzeQueue_push($this->_cPtr,$content); break;
		default: DocumentAnalyzeQueue_push($this->_cPtr,$content,$dclass);
		}
	}

	function hasMore() {
		return DocumentAnalyzeQueue_hasMore($this->_cPtr);
	}

	function fetch() {
		$r=DocumentAnalyzeQueue_fetch($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusDocument($r);
		}
		return $r;
	}
}

class StrusQueryAnalyzer {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o) {
		if (is_resource($o) && get_resource_type($o) === '_p_QueryAnalyzer') {
			$this->_cPtr=$o;
			return;
		}
		$this->_cPtr=new_StrusQueryAnalyzer($o);
	}

	function definePhraseType($phraseType,$featureType,$tokenizer,$normalizers) {
		StrusQueryAnalyzer_definePhraseType($this->_cPtr,$phraseType,$featureType,$tokenizer,$normalizers);
	}

	function analyzePhrase($phraseType,$phraseContent) {
		$r=StrusQueryAnalyzer_analyzePhrase($this->_cPtr,$phraseType,$phraseContent);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new TermVector($r);
		}
		return $r;
	}

	function createQueue() {
		$r=StrusQueryAnalyzer_createQueue($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusQueryAnalyzeQueue($r);
		}
		return $r;
	}
}

class StrusQueryAnalyzeQueue {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o) {
		if (is_resource($o) && get_resource_type($o) === '_p_QueryAnalyzeQueue') {
			$this->_cPtr=$o;
			return;
		}
		$this->_cPtr=new_StrusQueryAnalyzeQueue($o);
	}

	function push($phraseType,$phraseContent) {
		StrusQueryAnalyzeQueue_push($this->_cPtr,$phraseType,$phraseContent);
	}

	function fetch() {
		$r=StrusQueryAnalyzeQueue_fetch($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new TermVector($r);
		}
		return $r;
	}
}

class StrusStorageClient {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o) {
		if (is_resource($o) && get_resource_type($o) === '_p_StorageClient') {
			$this->_cPtr=$o;
			return;
		}
		$this->_cPtr=new_StrusStorageClient($o);
	}

	function nofDocumentsInserted() {
		return StrusStorageClient_nofDocumentsInserted($this->_cPtr);
	}

	function createTransaction() {
		$r=StrusStorageClient_createTransaction($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusStorageTransaction($r);
		}
		return $r;
	}

	function createInitStatisticsIterator($sign) {
		$r=StrusStorageClient_createInitStatisticsIterator($this->_cPtr,$sign);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StatisticsIterator($r);
		}
		return $r;
	}

	function createUpdateStatisticsIterator() {
		$r=StrusStorageClient_createUpdateStatisticsIterator($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StatisticsIterator($r);
		}
		return $r;
	}

	function close() {
		StrusStorageClient_close($this->_cPtr);
	}
}

class StrusStorageTransaction {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}
	function __construct($h) {
		$this->_cPtr=$h;
	}

	function insertDocument($docid,$doc) {
		StrusStorageTransaction_insertDocument($this->_cPtr,$docid,$doc);
	}

	function deleteDocument($docid) {
		StrusStorageTransaction_deleteDocument($this->_cPtr,$docid);
	}

	function deleteUserAccessRights($username) {
		StrusStorageTransaction_deleteUserAccessRights($this->_cPtr,$username);
	}

	function commit() {
		StrusStorageTransaction_commit($this->_cPtr);
	}

	function rollback() {
		StrusStorageTransaction_rollback($this->_cPtr);
	}
}

class DocumentFrequencyChange {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($type__or_o=null,$value_=null,$increment_=null) {
		if (is_resource($type__or_o) && get_resource_type($type__or_o) === '_p_DocumentFrequencyChange') {
			$this->_cPtr=$type__or_o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_DocumentFrequencyChange(); break;
		case 1: $this->_cPtr=new_DocumentFrequencyChange($type__or_o); break;
		case 2: $this->_cPtr=new_DocumentFrequencyChange($type__or_o,$value_); break;
		default: $this->_cPtr=new_DocumentFrequencyChange($type__or_o,$value_,$increment_);
		}
	}

	function type() {
		return DocumentFrequencyChange_type($this->_cPtr);
	}

	function value() {
		return DocumentFrequencyChange_value($this->_cPtr);
	}

	function increment() {
		return DocumentFrequencyChange_increment($this->_cPtr);
	}
}

class StatisticsMessage {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o_or_dfchglist,$nofdocs=null) {
		if (is_resource($o_or_dfchglist) && get_resource_type($o_or_dfchglist) === '_p_StatisticsMessage') {
			$this->_cPtr=$o_or_dfchglist;
			return;
		}
		switch (func_num_args()) {
		case 1: $this->_cPtr=new_StatisticsMessage($o_or_dfchglist); break;
		default: $this->_cPtr=new_StatisticsMessage($o_or_dfchglist,$nofdocs);
		}
	}

	function nofDocumentsInsertedChange() {
		return StatisticsMessage_nofDocumentsInsertedChange($this->_cPtr);
	}

	function documentFrequencyChangeList() {
		return StatisticsMessage_documentFrequencyChangeList($this->_cPtr);
	}
}

class StatisticsIterator {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o) {
		if (is_resource($o) && get_resource_type($o) === '_p_StatisticsIterator') {
			$this->_cPtr=$o;
			return;
		}
		$this->_cPtr=new_StatisticsIterator($o);
	}

	function getNext() {
		return StatisticsIterator_getNext($this->_cPtr);
	}
}

class StatisticsProcessor {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}
	function __construct($h) {
		$this->_cPtr=$h;
	}

	function decode($blob) {
		$r=StatisticsProcessor_decode($this->_cPtr,$blob);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StatisticsMessage($r);
		}
		return $r;
	}

	function encode($msg) {
		return StatisticsProcessor_encode($this->_cPtr,$msg);
	}
}

class StrusSummarizerConfig {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o=null) {
		if (is_resource($o) && get_resource_type($o) === '_p_SummarizerConfig') {
			$this->_cPtr=$o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusSummarizerConfig(); break;
		default: $this->_cPtr=new_StrusSummarizerConfig($o);
		}
	}

	function defineParameter($name,$value) {
		StrusSummarizerConfig_defineParameter($this->_cPtr,$name,$value);
	}

	function defineFeature($sumtype,$set) {
		StrusSummarizerConfig_defineFeature($this->_cPtr,$sumtype,$set);
	}
}

class StrusWeightingConfig {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o=null) {
		if (is_resource($o) && get_resource_type($o) === '_p_WeightingConfig') {
			$this->_cPtr=$o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusWeightingConfig(); break;
		default: $this->_cPtr=new_StrusWeightingConfig($o);
		}
	}

	function defineParameter($name,$value) {
		StrusWeightingConfig_defineParameter($this->_cPtr,$name,$value);
	}

	function defineFeature($sumtype,$set) {
		StrusWeightingConfig_defineFeature($this->_cPtr,$sumtype,$set);
	}
}

class StrusQueryEval {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o) {
		if (is_resource($o) && get_resource_type($o) === '_p_QueryEval') {
			$this->_cPtr=$o;
			return;
		}
		$this->_cPtr=new_StrusQueryEval($o);
	}

	function addTerm($set_,$type_,$value_) {
		StrusQueryEval_addTerm($this->_cPtr,$set_,$type_,$value_);
	}

	function addSelectionFeature($set_) {
		StrusQueryEval_addSelectionFeature($this->_cPtr,$set_);
	}

	function addRestrictionFeature($set_) {
		StrusQueryEval_addRestrictionFeature($this->_cPtr,$set_);
	}

	function addExclusionFeature($set_) {
		StrusQueryEval_addExclusionFeature($this->_cPtr,$set_);
	}

	function addSummarizer($resultAttribute,$name,$config) {
		StrusQueryEval_addSummarizer($this->_cPtr,$resultAttribute,$name,$config);
	}

	function addWeightingFunction($weight,$name,$config) {
		StrusQueryEval_addWeightingFunction($this->_cPtr,$weight,$name,$config);
	}

	function createQuery($storage) {
		$r=StrusQueryEval_createQuery($this->_cPtr,$storage);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusQuery($r);
		}
		return $r;
	}
}

class StrusRankAttribute {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($name__or_o=null,$value_=null,$weight_=null) {
		if (is_resource($name__or_o) && get_resource_type($name__or_o) === '_p_RankAttribute') {
			$this->_cPtr=$name__or_o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusRankAttribute(); break;
		case 1: $this->_cPtr=new_StrusRankAttribute($name__or_o); break;
		case 2: $this->_cPtr=new_StrusRankAttribute($name__or_o,$value_); break;
		default: $this->_cPtr=new_StrusRankAttribute($name__or_o,$value_,$weight_);
		}
	}

	function name() {
		return StrusRankAttribute_name($this->_cPtr);
	}

	function value() {
		return StrusRankAttribute_value($this->_cPtr);
	}

	function weight() {
		return StrusRankAttribute_weight($this->_cPtr);
	}
}

class StrusRank {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($docno__or_o=null,$weight_=null,$attributes_=null) {
		if (is_resource($docno__or_o) && get_resource_type($docno__or_o) === '_p_Rank') {
			$this->_cPtr=$docno__or_o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusRank(); break;
		case 1: $this->_cPtr=new_StrusRank($docno__or_o); break;
		case 2: $this->_cPtr=new_StrusRank($docno__or_o,$weight_); break;
		default: $this->_cPtr=new_StrusRank($docno__or_o,$weight_,$attributes_);
		}
	}

	function docno() {
		return StrusRank_docno($this->_cPtr);
	}

	function weight() {
		return StrusRank_weight($this->_cPtr);
	}

	function attributes() {
		return StrusRank_attributes($this->_cPtr);
	}
}

class StrusQueryExpression {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o=null) {
		if (is_resource($o) && get_resource_type($o) === '_p_QueryExpression') {
			$this->_cPtr=$o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusQueryExpression(); break;
		default: $this->_cPtr=new_StrusQueryExpression($o);
		}
	}

	function pushTerm($type_,$value_) {
		StrusQueryExpression_pushTerm($this->_cPtr,$type_,$value_);
	}

	function pushExpression($opname_,$argc_,$range_=0,$cardinality_=0) {
		StrusQueryExpression_pushExpression($this->_cPtr,$opname_,$argc_,$range_,$cardinality_);
	}

	function attachVariable($name_) {
		StrusQueryExpression_attachVariable($this->_cPtr,$name_);
	}

	function add($o) {
		StrusQueryExpression_add($this->_cPtr,$o);
	}

	function size() {
		return StrusQueryExpression_size($this->_cPtr);
	}
}

class StrusTermStatistics {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($df__or_o=null) {
		if (is_resource($df__or_o) && get_resource_type($df__or_o) === '_p_TermStatistics') {
			$this->_cPtr=$df__or_o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusTermStatistics(); break;
		default: $this->_cPtr=new_StrusTermStatistics($df__or_o);
		}
	}

	function df() {
		return StrusTermStatistics_df($this->_cPtr);
	}

	function set_df($df_) {
		StrusTermStatistics_set_df($this->_cPtr,$df_);
	}
}

class StrusGlobalStatistics {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($nofDocumentsInserted__or_o=null) {
		if (is_resource($nofDocumentsInserted__or_o) && get_resource_type($nofDocumentsInserted__or_o) === '_p_GlobalStatistics') {
			$this->_cPtr=$nofDocumentsInserted__or_o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusGlobalStatistics(); break;
		default: $this->_cPtr=new_StrusGlobalStatistics($nofDocumentsInserted__or_o);
		}
	}

	function nofdocs() {
		return StrusGlobalStatistics_nofdocs($this->_cPtr);
	}

	function set_nofdocs($nofdocs_) {
		StrusGlobalStatistics_set_nofdocs($this->_cPtr,$nofdocs_);
	}
}

class StrusQuery {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($o) {
		if (is_resource($o) && get_resource_type($o) === '_p_Query') {
			$this->_cPtr=$o;
			return;
		}
		$this->_cPtr=new_StrusQuery($o);
	}

	function defineFeature($set_,$expr_,$weight_) {
		StrusQuery_defineFeature($this->_cPtr,$set_,$expr_,$weight_);
	}

	function defineMetaDataRestriction($compareOp,$name,$value,$newGroup=true) {
		StrusQuery_defineMetaDataRestriction($this->_cPtr,$compareOp,$name,$value,$newGroup);
	}

	function defineTermStatistics($type_,$value_,$stats_) {
		StrusQuery_defineTermStatistics($this->_cPtr,$type_,$value_,$stats_);
	}

	function defineGlobalStatistics($stats_) {
		StrusQuery_defineGlobalStatistics($this->_cPtr,$stats_);
	}

	function addDocumentEvaluationSet($docnolist_) {
		StrusQuery_addDocumentEvaluationSet($this->_cPtr,$docnolist_);
	}

	function setMaxNofRanks($maxNofRanks_) {
		StrusQuery_setMaxNofRanks($this->_cPtr,$maxNofRanks_);
	}

	function setMinRank($minRank_) {
		StrusQuery_setMinRank($this->_cPtr,$minRank_);
	}

	function addUserName($username_) {
		StrusQuery_addUserName($this->_cPtr,$username_);
	}

	function evaluate() {
		$r=StrusQuery_evaluate($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new RankVector($r);
		}
		return $r;
	}
}

class StrusContext {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'thisown') return swig_strus_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __get($var) {
		if ($var === 'thisown') return swig_strus_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	function __isset($var) {
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __construct($maxNofThreads_or_connectionstring_or_o=null,$maxNofThreads=null) {
		if (is_resource($maxNofThreads_or_connectionstring_or_o) && get_resource_type($maxNofThreads_or_connectionstring_or_o) === '_p_Context') {
			$this->_cPtr=$maxNofThreads_or_connectionstring_or_o;
			return;
		}
		switch (func_num_args()) {
		case 0: $this->_cPtr=new_StrusContext(); break;
		case 1: $this->_cPtr=new_StrusContext($maxNofThreads_or_connectionstring_or_o); break;
		default: $this->_cPtr=new_StrusContext($maxNofThreads_or_connectionstring_or_o,$maxNofThreads);
		}
	}

	function loadModule($name_) {
		StrusContext_loadModule($this->_cPtr,$name_);
	}

	function addModulePath($paths_) {
		StrusContext_addModulePath($this->_cPtr,$paths_);
	}

	function addResourcePath($paths_) {
		StrusContext_addResourcePath($this->_cPtr,$paths_);
	}

	function defineStatisticsProcessor($name_) {
		StrusContext_defineStatisticsProcessor($this->_cPtr,$name_);
	}

	function createStatisticsProcessor() {
		$r=StrusContext_createStatisticsProcessor($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StatisticsProcessor($r);
		}
		return $r;
	}

	function createStorageClient($config_=null) {
		switch (func_num_args()) {
		case 0: $r=StrusContext_createStorageClient($this->_cPtr); break;
		default: $r=StrusContext_createStorageClient($this->_cPtr,$config_);
		}
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusStorageClient($r);
		}
		return $r;
	}

	function createStorage($config_) {
		StrusContext_createStorage($this->_cPtr,$config_);
	}

	function destroyStorage($config_) {
		StrusContext_destroyStorage($this->_cPtr,$config_);
	}

	function detectDocumentClass($content) {
		$r=StrusContext_detectDocumentClass($this->_cPtr,$content);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusDocumentClass($r);
		}
		return $r;
	}

	function createDocumentAnalyzer($segmentername_=null) {
		switch (func_num_args()) {
		case 0: $r=StrusContext_createDocumentAnalyzer($this->_cPtr); break;
		default: $r=StrusContext_createDocumentAnalyzer($this->_cPtr,$segmentername_);
		}
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusDocumentAnalyzer($r);
		}
		return $r;
	}

	function createQueryAnalyzer() {
		$r=StrusContext_createQueryAnalyzer($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusQueryAnalyzer($r);
		}
		return $r;
	}

	function createQueryEval() {
		$r=StrusContext_createQueryEval($this->_cPtr);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (class_exists($c)) return new $c($r);
			return new StrusQueryEval($r);
		}
		return $r;
	}

	function close() {
		StrusContext_close($this->_cPtr);
	}
}


?>
