You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by va...@apache.org on 2009/03/09 23:55:29 UTC
svn commit: r751897 - in /lucene/pylucene/trunk: ./
java/org/apache/pylucene/queryParser/ jcc/jcc/ samples/ test/
Author: vajda
Date: Mon Mar 9 22:55:28 2009
New Revision: 751897
URL: http://svn.apache.org/viewvc?rev=751897&view=rev
Log:
- fixed bug in PythonQueryParser overriding wrong method (Aaron Lav)
- fixed more copyright notices
Added:
lucene/pylucene/trunk/test/test_PythonQueryParser.py (with props)
Removed:
lucene/pylucene/trunk/samples/JavaSet.py
Modified:
lucene/pylucene/trunk/CHANGES
lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonMultiFieldQueryParser.java
lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonQueryParser.java
lucene/pylucene/trunk/jcc/jcc/python.py
lucene/pylucene/trunk/samples/PorterStemmerAnalyzer.py
lucene/pylucene/trunk/samples/ThreadIndexFiles.py
lucene/pylucene/trunk/samples/manindex.py
lucene/pylucene/trunk/samples/mansearch.py
lucene/pylucene/trunk/test/test_Analyzers.py
lucene/pylucene/trunk/test/test_Binary.py
lucene/pylucene/trunk/test/test_BooleanOr.py
lucene/pylucene/trunk/test/test_BooleanPrefixQuery.py
lucene/pylucene/trunk/test/test_BooleanQuery.py
lucene/pylucene/trunk/test/test_CachingWrapperFilter.py
lucene/pylucene/trunk/test/test_Compress.py
lucene/pylucene/trunk/test/test_DocBoost.py
lucene/pylucene/trunk/test/test_FilteredQuery.py
lucene/pylucene/trunk/test/test_FuzzyQuery.py
lucene/pylucene/trunk/test/test_Highlighter.py
lucene/pylucene/trunk/test/test_Not.py
lucene/pylucene/trunk/test/test_PerFieldAnalyzerWrapper.py
lucene/pylucene/trunk/test/test_PhraseQuery.py
lucene/pylucene/trunk/test/test_PositionIncrement.py
lucene/pylucene/trunk/test/test_PrefixFilter.py
lucene/pylucene/trunk/test/test_PrefixQuery.py
lucene/pylucene/trunk/test/test_PyLucene.py
lucene/pylucene/trunk/test/test_PyLuceneThread.py
lucene/pylucene/trunk/test/test_PythonDirectory.py
Modified: lucene/pylucene/trunk/CHANGES
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/CHANGES?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/CHANGES (original)
+++ lucene/pylucene/trunk/CHANGES Mon Mar 9 22:55:28 2009
@@ -7,6 +7,7 @@
- documentation moved to http://lucene.apache.org/pylucene
- added java.util.Arrays to the build to bridge the Java array/collection gap
- added collections.py module with JavaSet class, a Python java.util.Set
+ - fixed bug in PythonQueryParser overriding wrong method (Aaron Lav)
-
Version 2.3.2 -> 2.4.0
Modified: lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonMultiFieldQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonMultiFieldQueryParser.java?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonMultiFieldQueryParser.java (original)
+++ lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonMultiFieldQueryParser.java Mon Mar 9 22:55:28 2009
@@ -15,7 +15,7 @@
package org.apache.pylucene.queryParser;
-import java.util.Vector;
+import java.util.List;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.search.Query;
@@ -48,7 +48,7 @@
}
public native void pythonDecRef();
- public native Query getBooleanQuery(Vector clauses);
+ public native Query getBooleanQuery(List clauses, boolean disableCoord);
public native Query getFieldQuery(String field, String queryText);
public native Query getFieldQuery(String field, String queryText, int slop);
public native Query getFuzzyQuery(String field, String termText,
Modified: lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonQueryParser.java?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonQueryParser.java (original)
+++ lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonQueryParser.java Mon Mar 9 22:55:28 2009
@@ -15,7 +15,7 @@
package org.apache.pylucene.queryParser;
-import java.util.Vector;
+import java.util.List;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.search.Query;
@@ -54,7 +54,7 @@
}
public native void pythonDecRef();
- public native Query getBooleanQuery(Vector clauses);
+ public native Query getBooleanQuery(List clauses, boolean disableCoord);
public native Query getFieldQuery(String field, String queryText);
public native Query getFieldQuery(String field, String queryText, int slop);
public native Query getFuzzyQuery(String field, String termText,
Modified: lucene/pylucene/trunk/jcc/jcc/python.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/jcc/python.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/python.py (original)
+++ lucene/pylucene/trunk/jcc/jcc/python.py Mon Mar 9 22:55:28 2009
@@ -488,14 +488,14 @@
elif name + '_' in allMethods:
allMethods[name + '_'].append(method)
else:
- print >>sys.stderr, "Renaming static method %s on class %s to %s_ since it is shadowed by non-static method of same name." %(name, '.'.join(names), name)
+ print >>sys.stderr, "Renaming static method '%s' on class %s to '%s_' since it is shadowed by non-static method of same name." %(name, '.'.join(names), name)
allMethods[name + '_'] = [method]
else:
allMethods[name] = [method]
else:
if name in allMethods:
if Modifier.isStatic(allMethods[name][0].getModifiers()):
- print >>sys.stderr, "Renaming static method %s on class %s to %s_ since it is shadowed by non-static method of same name." %(name, '.'.join(names), name)
+ print >>sys.stderr, "Renaming static method '%s' on class %s to '%s_' since it is shadowed by non-static method of same name." %(name, '.'.join(names), name)
allMethods[name + '_'] = allMethods[name]
allMethods[name] = [method]
else:
Modified: lucene/pylucene/trunk/samples/PorterStemmerAnalyzer.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/PorterStemmerAnalyzer.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/samples/PorterStemmerAnalyzer.py (original)
+++ lucene/pylucene/trunk/samples/PorterStemmerAnalyzer.py Mon Mar 9 22:55:28 2009
@@ -1,25 +1,16 @@
# ====================================================================
-# Copyright (c) 2004-2007 Open Source Applications Foundation.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
# ====================================================================
-#
# This sample illustrates how to write an Analyzer 'extension' in Python.
#
Modified: lucene/pylucene/trunk/samples/ThreadIndexFiles.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/ThreadIndexFiles.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/samples/ThreadIndexFiles.py (original)
+++ lucene/pylucene/trunk/samples/ThreadIndexFiles.py Mon Mar 9 22:55:28 2009
@@ -1,25 +1,16 @@
# ====================================================================
-# Copyright (c) 2004-2007 Open Source Applications Foundation.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
# ====================================================================
-#
# This sample illustrates how to use a thread with PyLucene
Modified: lucene/pylucene/trunk/samples/manindex.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/manindex.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/samples/manindex.py (original)
+++ lucene/pylucene/trunk/samples/manindex.py Mon Mar 9 22:55:28 2009
@@ -1,23 +1,15 @@
# ====================================================================
-# Copyright (c) 2004-2007 Open Source Applications Foundation.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
# ====================================================================
#
# Author: Erik Hatcher
Modified: lucene/pylucene/trunk/samples/mansearch.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/mansearch.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/samples/mansearch.py (original)
+++ lucene/pylucene/trunk/samples/mansearch.py Mon Mar 9 22:55:28 2009
@@ -1,23 +1,15 @@
# ====================================================================
-# Copyright (c) 2004-2007 Open Source Applications Foundation.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
# ====================================================================
#
# Author: Erik Hatcher
Modified: lucene/pylucene/trunk/test/test_Analyzers.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_Analyzers.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_Analyzers.py (original)
+++ lucene/pylucene/trunk/test/test_Analyzers.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_Binary.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_Binary.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_Binary.py (original)
+++ lucene/pylucene/trunk/test/test_Binary.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_BooleanOr.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_BooleanOr.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_BooleanOr.py (original)
+++ lucene/pylucene/trunk/test/test_BooleanOr.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_BooleanPrefixQuery.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_BooleanPrefixQuery.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_BooleanPrefixQuery.py (original)
+++ lucene/pylucene/trunk/test/test_BooleanPrefixQuery.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_BooleanQuery.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_BooleanQuery.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_BooleanQuery.py (original)
+++ lucene/pylucene/trunk/test/test_BooleanQuery.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_CachingWrapperFilter.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_CachingWrapperFilter.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_CachingWrapperFilter.py (original)
+++ lucene/pylucene/trunk/test/test_CachingWrapperFilter.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_Compress.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_Compress.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_Compress.py (original)
+++ lucene/pylucene/trunk/test/test_Compress.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_DocBoost.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_DocBoost.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_DocBoost.py (original)
+++ lucene/pylucene/trunk/test/test_DocBoost.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_FilteredQuery.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_FilteredQuery.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_FilteredQuery.py (original)
+++ lucene/pylucene/trunk/test/test_FilteredQuery.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_FuzzyQuery.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_FuzzyQuery.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_FuzzyQuery.py (original)
+++ lucene/pylucene/trunk/test/test_FuzzyQuery.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_Highlighter.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_Highlighter.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_Highlighter.py (original)
+++ lucene/pylucene/trunk/test/test_Highlighter.py Mon Mar 9 22:55:28 2009
@@ -1,25 +1,16 @@
# ====================================================================
-# Copyright (c) 2004-2007 Open Source Applications Foundation.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
# ====================================================================
-#
from unittest import TestCase, main
from lucene import *
Modified: lucene/pylucene/trunk/test/test_Not.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_Not.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_Not.py (original)
+++ lucene/pylucene/trunk/test/test_Not.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_PerFieldAnalyzerWrapper.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_PerFieldAnalyzerWrapper.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_PerFieldAnalyzerWrapper.py (original)
+++ lucene/pylucene/trunk/test/test_PerFieldAnalyzerWrapper.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_PhraseQuery.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_PhraseQuery.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_PhraseQuery.py (original)
+++ lucene/pylucene/trunk/test/test_PhraseQuery.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_PositionIncrement.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_PositionIncrement.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_PositionIncrement.py (original)
+++ lucene/pylucene/trunk/test/test_PositionIncrement.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_PrefixFilter.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_PrefixFilter.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_PrefixFilter.py (original)
+++ lucene/pylucene/trunk/test/test_PrefixFilter.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_PrefixQuery.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_PrefixQuery.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_PrefixQuery.py (original)
+++ lucene/pylucene/trunk/test/test_PrefixQuery.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_PyLucene.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_PyLucene.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_PyLucene.py (original)
+++ lucene/pylucene/trunk/test/test_PyLucene.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_PyLuceneThread.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_PyLuceneThread.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_PyLuceneThread.py (original)
+++ lucene/pylucene/trunk/test/test_PyLuceneThread.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Modified: lucene/pylucene/trunk/test/test_PythonDirectory.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_PythonDirectory.py?rev=751897&r1=751896&r2=751897&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_PythonDirectory.py (original)
+++ lucene/pylucene/trunk/test/test_PythonDirectory.py Mon Mar 9 22:55:28 2009
@@ -1,6 +1,4 @@
# ====================================================================
-# Copyright (c) 2004-2008 Open Source Applications Foundation
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Added: lucene/pylucene/trunk/test/test_PythonQueryParser.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_PythonQueryParser.py?rev=751897&view=auto
==============================================================================
--- lucene/pylucene/trunk/test/test_PythonQueryParser.py (added)
+++ lucene/pylucene/trunk/test/test_PythonQueryParser.py Mon Mar 9 22:55:28 2009
@@ -0,0 +1,68 @@
+# ====================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ====================================================================
+
+from unittest import TestCase, main
+from lucene import *
+
+
+class BooleanTestMixin(object):
+
+ def getBooleanQuery(self, clauses, disableCoord):
+
+ extra_query = TermQuery(Term("all", "extra_clause"))
+ extra_clause = BooleanClause(extra_query, BooleanClause.Occur.SHOULD)
+ clauses.add(extra_clause)
+
+ return super(BooleanTestMixin, self).getBooleanQuery(clauses,
+ disableCoord)
+
+
+class PythonQueryParserTestCase(TestCase):
+
+ def testOverrideBooleanQuery(self):
+
+ class TestQueryParser(BooleanTestMixin, PythonQueryParser):
+ pass
+
+ qp = TestQueryParser('all', StandardAnalyzer())
+ q = qp.parse("foo bar")
+ self.assertEquals(str(q), "all:foo all:bar all:extra_clause")
+
+
+class PythonMultiFieldQueryParserTestCase(TestCase):
+
+ def testOverrideBooleanQuery(self):
+
+ class TestQueryParser(BooleanTestMixin, PythonMultiFieldQueryParser):
+ pass
+
+ qp = TestQueryParser(['one', 'two'], StandardAnalyzer())
+ q = qp.parse("foo bar", ['one', 'two'],
+ [BooleanClause.Occur.SHOULD, BooleanClause.Occur.SHOULD],
+ StandardAnalyzer())
+ self.assertEquals(str(q), "(one:foo one:bar) (two:foo two:bar)")
+
+
+if __name__ == "__main__":
+ import sys
+ initVM(CLASSPATH)
+ if '-loop' in sys.argv:
+ sys.argv.remove('-loop')
+ while True:
+ try:
+ main()
+ except:
+ pass
+ else:
+ main()
Propchange: lucene/pylucene/trunk/test/test_PythonQueryParser.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/test/test_PythonQueryParser.py
------------------------------------------------------------------------------
svn:mime-type = text/plain