javamatch-cvs Mailing List for JavaMatch match engine
Status: Pre-Alpha
Brought to you by:
iterson
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(70) |
Oct
(4) |
Nov
|
Dec
|
---|
From: Walter v. I. <it...@us...> - 2004-10-01 10:34:16
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1983/test Modified Files: MatchEngineTest.java Log Message: Added getter for maxNumResultItems Index: MatchEngineTest.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/test/MatchEngineTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MatchEngineTest.java 1 Oct 2004 08:02:10 -0000 1.7 --- MatchEngineTest.java 1 Oct 2004 10:33:56 -0000 1.8 *************** *** 268,270 **** --- 268,281 ---- } } + + public void testSetGetMaxNumResultItems() { + MatchEngine engine = new MatchEngine(); + engine.setMaxNumResultItems(100); + assertEquals(100, engine.getMaxNumResultItems()); + } + + public void testGetDefaultMaxNumResultItems() { + MatchEngine engine = new MatchEngine(); + assertEquals(10, engine.getMaxNumResultItems()); + } } |
From: Walter v. I. <it...@us...> - 2004-10-01 10:34:16
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1983 Modified Files: MatchEngine.java Log Message: Added getter for maxNumResultItems Index: MatchEngine.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/MatchEngine.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MatchEngine.java 1 Oct 2004 08:02:09 -0000 1.8 --- MatchEngine.java 1 Oct 2004 10:33:56 -0000 1.9 *************** *** 124,127 **** --- 124,134 ---- } + /** + * Returns the maximum number of result items to be returned in a query + */ + public int getMaxNumResultItems() { + return maxNumResultItems; + } + /** * Sets the threshold value, the minimum value that each sub-query should have, |
From: Walter v. I. <it...@us...> - 2004-10-01 08:02:24
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6829 Modified Files: MatchEngine.java Log Message: Added getter for threshold Index: MatchEngine.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/MatchEngine.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MatchEngine.java 23 Sep 2004 06:11:54 -0000 1.7 --- MatchEngine.java 1 Oct 2004 08:02:09 -0000 1.8 *************** *** 125,129 **** /** ! * Sets the threshold value, the minimum value that each sub-query shoud have, * to be included in the match result. The default threshold is 0.01, so * total mismatches will not be part of the result --- 125,129 ---- /** ! * Sets the threshold value, the minimum value that each sub-query should have, * to be included in the match result. The default threshold is 0.01, so * total mismatches will not be part of the result *************** *** 135,138 **** --- 135,147 ---- } + /** + * Returns the threshold value, the minimum value that each sub-query should + * have, to be included in the match result. + * @return the threshold value + */ + public float getThreshold() { + return threshold; + } + /** * Retrieves and returns the object or object with the given identifier from |
From: Walter v. I. <it...@us...> - 2004-10-01 08:02:23
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6829/test Modified Files: MatchEngineTest.java Log Message: Added getter for threshold Index: MatchEngineTest.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/test/MatchEngineTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MatchEngineTest.java 23 Sep 2004 06:11:55 -0000 1.6 --- MatchEngineTest.java 1 Oct 2004 08:02:10 -0000 1.7 *************** *** 186,189 **** --- 186,195 ---- } + public void testSetGetThreshold() { + MatchEngine engine = new MatchEngine(); + engine.setThreshold(0.4f); + assertEquals(0.4f, engine.getThreshold(), 0.0001f); + } + public void testThreshold() { try { |
From: Walter v. I. <it...@us...> - 2004-09-23 06:12:04
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8468 Modified Files: MatchEngine.java Log Message: Set default threshold to 0.01, to exclude total mismatches Index: MatchEngine.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/MatchEngine.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MatchEngine.java 20 Sep 2004 08:25:46 -0000 1.6 --- MatchEngine.java 23 Sep 2004 06:11:54 -0000 1.7 *************** *** 37,42 **** /** The threshold value, the minimum value that each sub-query shoud have, ! to be included in the match result */ ! private float threshold = 0f; /** --- 37,43 ---- /** The threshold value, the minimum value that each sub-query shoud have, ! to be included in the match result. The default threshold is 0.01, so ! total mismatches will not be part of the result */ ! private float threshold = 0.01f; /** *************** *** 125,129 **** /** * Sets the threshold value, the minimum value that each sub-query shoud have, ! * to be included in the match result * @param threshold the threshold, the minimum query result value before an * object is included in the MatchResult --- 126,131 ---- /** * Sets the threshold value, the minimum value that each sub-query shoud have, ! * to be included in the match result. The default threshold is 0.01, so ! * total mismatches will not be part of the result * @param threshold the threshold, the minimum query result value before an * object is included in the MatchResult |
From: Walter v. I. <it...@us...> - 2004-09-23 06:12:04
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8468/test Modified Files: MatchEngineTest.java Log Message: Set default threshold to 0.01, to exclude total mismatches Index: MatchEngineTest.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/test/MatchEngineTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MatchEngineTest.java 14 Sep 2004 13:29:25 -0000 1.5 --- MatchEngineTest.java 23 Sep 2004 06:11:55 -0000 1.6 *************** *** 209,212 **** --- 209,233 ---- } + public void testDefaultThresholdBoundaries() { + try { + MatchEngine engine = new MatchEngine(); + MatchQuery query = new ObjectValueQuery("floatValue"); + Vector objects = new Vector(); + objects.add(new DataObject(0.0f)); + objects.add(new DataObject(0.009f)); + objects.add(new DataObject(0.010f)); + objects.add(new DataObject(0.011f)); + objects.add(new DataObject(0.012f)); + MatchResult result = engine.executeQuery(query, objects); + Iterator resultIterator = result.getResultIterator(); + assertEquals(0.012f, ((ResultItem)resultIterator.next()).getMatchValue(), 0.001f); + assertEquals(0.011f, ((ResultItem)resultIterator.next()).getMatchValue(), 0.001f); + assertEquals(0.010f, ((ResultItem)resultIterator.next()).getMatchValue(), 0.001f); + assertFalse(resultIterator.hasNext()); + } catch (MatchException me) { + fail("unable to match"); + } + } + public void testSetNegativeMaxNumResultItems() { MatchEngine engine = new MatchEngine(); |
From: Walter v. I. <it...@us...> - 2004-09-23 06:04:16
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/query In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7065 Modified Files: QuerySet.java Log Message: Bug fix: Also include the match value of the required queries Index: QuerySet.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/query/QuerySet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** QuerySet.java 14 Sep 2004 06:59:37 -0000 1.3 --- QuerySet.java 23 Sep 2004 06:04:06 -0000 1.4 *************** *** 139,143 **** } float totalWeight = requiredQueries.size(); ! float totalMatchValue = 0; queryIterator = preferredQueries.iterator(); while (queryIterator.hasNext()) { --- 139,143 ---- } float totalWeight = requiredQueries.size(); ! float totalMatchValue = totalWeight; // all required queries have match value 1 queryIterator = preferredQueries.iterator(); while (queryIterator.hasNext()) { |
From: Walter v. I. <it...@us...> - 2004-09-23 06:04:16
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/query/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7065/test Modified Files: QuerySetTest.java Log Message: Bug fix: Also include the match value of the required queries Index: QuerySetTest.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/query/test/QuerySetTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** QuerySetTest.java 14 Sep 2004 06:59:37 -0000 1.3 --- QuerySetTest.java 23 Sep 2004 06:04:06 -0000 1.4 *************** *** 99,104 **** QuerySet curQuery = new QuerySet(); curQuery.addRequired(new ConstantMatch(1.0f)); curQuery.addPreferred(new ConstantMatch(0.3f)); ! assertEquals(0.15f, curQuery.getMatchValue(new Object()), 0.01f); } catch (MatchException me) { fail("unable to match"); --- 99,114 ---- QuerySet curQuery = new QuerySet(); curQuery.addRequired(new ConstantMatch(1.0f)); + assertEquals(1.0f, curQuery.getMatchValue(new Object()), 0.01f); + } catch (MatchException me) { + fail("unable to match"); + } + } + + public void testRequiredPreferredMatch() { + try { + QuerySet curQuery = new QuerySet(); + curQuery.addRequired(new ConstantMatch(1.0f)); curQuery.addPreferred(new ConstantMatch(0.3f)); ! assertEquals(0.65f, curQuery.getMatchValue(new Object()), 0.01f); } catch (MatchException me) { fail("unable to match"); *************** *** 106,110 **** } ! public void testRequiredMismatch() { try { QuerySet curQuery = new QuerySet(); --- 116,120 ---- } ! public void testRequiredPreferredMismatch() { try { QuerySet curQuery = new QuerySet(); |
From: Walter v. I. <it...@us...> - 2004-09-20 11:32:04
|
Update of /cvsroot/javamatch/javamatch/docs/website/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8583/docs/website/resources Removed Files: javamatch.jar Log Message: Remove (link to) snapshot, can use release 0.2 --- javamatch.jar DELETED --- |
From: Walter v. I. <it...@us...> - 2004-09-20 11:32:04
|
Update of /cvsroot/javamatch/javamatch/docs/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8583/docs/website Modified Files: javamatch.xml Log Message: Remove (link to) snapshot, can use release 0.2 Index: javamatch.xml =================================================================== RCS file: /cvsroot/javamatch/javamatch/docs/website/javamatch.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** javamatch.xml 20 Sep 2004 08:25:45 -0000 1.12 --- javamatch.xml 20 Sep 2004 11:31:55 -0000 1.13 *************** *** 460,464 **** JavaMatch works in combination with such storage mechanisms. </p> ! <h2>JDO</h2> <p class="intro"><a href="http://www.jdocentral.com">JDO</a>, the standard for transparent object persistence, enables you to match in databases. JDO has a --- 460,464 ---- JavaMatch works in combination with such storage mechanisms. </p> ! <h2><a name="jdo"/>JDO</h2> <p class="intro"><a href="http://www.jdocentral.com">JDO</a>, the standard for transparent object persistence, enables you to match in databases. JDO has a *************** *** 506,513 **** directory, and add this to the classpath when compiling / running the application. </p> - <p><b><i> - Note: This will not work with release 0.1, as the syntax for retrieving class members has - changed since release 0.1 Please use the <a href="javamatch.jar">snapshot version</a> instead. - </i></b></p> <p>If you have <a href="http://ant.apache.org">ant</a>, you might want to use <a href="prevayler/build.xml">build.xml</a>. Put it in the prevayler-X.YY.ZZZ directory, --- 506,509 ---- *************** *** 554,557 **** --- 550,554 ---- technology)</li> <li><a href="integration.html#jdo">Performance optimizations</a> for JDO</li> + <li>New example, that can be used for performance tests (random color finder)</li> </ul> </td> *************** *** 579,582 **** --- 576,584 ---- </tr> <tr> + <td>20040920</td> + <td>Added (unoptimized) JDO match engine<br/> + <b>Created release 0.2</b></td> + </tr> + <tr> <td>20040914</td> <td>Restructured the web site</td> |
From: Walter v. I. <it...@us...> - 2004-09-20 11:19:48
|
Update of /cvsroot/javamatch/javamatch In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5607 Modified Files: license.txt Log Message: Added JDO Index: license.txt =================================================================== RCS file: /cvsroot/javamatch/javamatch/license.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** license.txt 3 Sep 2004 08:21:01 -0000 1.1.1.1 --- license.txt 20 Sep 2004 11:19:39 -0000 1.2 *************** *** 2,6 **** This license can be found in docs/LGPL_License.txt ! The binary distribution does not use any external libraries. During the build process, tests are executed by JUnit. (http://www.junit.org) --- 2,9 ---- This license can be found in docs/LGPL_License.txt ! The binary distribution uses, but does not include the following library: ! - JDO API, version 1.0.1 (http://www.jcp.org/aboutJava/communityprocess/final/jsr012/) ! To use the JDOMatchEngine, you should include the JDO implementation you use ! in your classpath. During the build process, tests are executed by JUnit. (http://www.junit.org) |
From: Walter v. I. <it...@us...> - 2004-09-20 08:26:03
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2618/src/net/sourceforge/javamatch/engine/test Modified Files: TestAll.java Added Files: ExtentMock.java JDOMatchEngineTest.java PersistenceManagerMock.java Log Message: Added (unoptimized) JDO implementation --- NEW FILE: JDOMatchEngineTest.java --- /* JavaMatch: Matching engine for Java runtime data structures * Copyright (C) 2004 Walter van Iterson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.javamatch.engine.test; import java.util.*; import javax.jdo.*; import junit.framework.*; import net.sourceforge.javamatch.engine.*; import net.sourceforge.javamatch.query.*; import net.sourceforge.javamatch.query.test.*; /** * Class JDOMatchEngineTest tests the JDOMatchEngine functionality */ public class JDOMatchEngineTest extends TestCase { public JDOMatchEngineTest(String name) { super(name); } public void testCreateNullPersistenceManager() { try { new JDOMatchEngine(null); fail("Shouldn't be ableto create JDOMatchEngine with null persistence manager"); } catch (NullPointerException npe) { // should occur } } public void testUnusedObjectsAreEvicted() { PersistenceManagerMock persistenceManager = new PersistenceManagerMock(); JDOMatchEngine matchEngine = new JDOMatchEngine(persistenceManager); MatchResult matchResult = new MatchResult(matchEngine); matchResult.setMaxNumResultItems(1); matchResult.addResultItem(new Object(), 0.2f); Object object = new Object(); persistenceManager.expectEvict(object); matchResult.addResultItem(object, 0.1f); persistenceManager.validate(); } public void testNullExtent() { PersistenceManagerMock persistenceManager = new PersistenceManagerMock(); JDOMatchEngine matchEngine = new JDOMatchEngine(persistenceManager); try { matchEngine.executeQuery(new ConstantMatch(3f), (Extent)null); fail("Shouldn't be able to execute query with null extent"); } catch (NullPointerException npe) { // should occur } catch (MatchException me) { fail("unable to match"); } } public void testIteratorsClosed() { PersistenceManagerMock persistenceManager = new PersistenceManagerMock(); JDOMatchEngine matchEngine = new JDOMatchEngine(persistenceManager); ExtentMock extent = new ExtentMock(); extent.expectClose(); extent.expectClose(); try { matchEngine.executeQuery(new ConstantMatch(3f), extent); } catch (NullPointerException npe) { // should occur extent.validate(); } catch (MatchException me) { fail("unable to match"); } } } Index: TestAll.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/test/TestAll.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TestAll.java 3 Sep 2004 08:21:22 -0000 1.1.1.1 --- TestAll.java 20 Sep 2004 08:25:46 -0000 1.2 *************** *** 36,39 **** --- 36,40 ---- suite.addTestSuite(MatchEngineTest.class); suite.addTestSuite(MatchResultTest.class); + suite.addTestSuite(JDOMatchEngineTest.class); // ... and others return suite; --- NEW FILE: ExtentMock.java --- /* JavaMatch: Matching engine for Java runtime data structures * Copyright (C) 2004 Walter van Iterson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.javamatch.engine.test; import java.util.*; import javax.jdo.*; import net.sourceforge.javamatch.test.*; public class ExtentMock extends ExpectationList implements Extent { public void expectClose() { expect("close"); } public Iterator iterator() { return null; } public boolean hasSubclasses() { return false; } public Class getCandidateClass() { return null; } public PersistenceManager getPersistenceManager() { return null; } public void closeAll() {} public void close(Iterator i) { encounter("close"); } } --- NEW FILE: PersistenceManagerMock.java --- /* JavaMatch: Matching engine for Java runtime data structures * Copyright (C) 2004 Walter van Iterson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.javamatch.engine.test; import java.util.*; import javax.jdo.*; import net.sourceforge.javamatch.test.*; public class PersistenceManagerMock extends ExpectationList implements PersistenceManager { public void expectEvict(Object objectToEvict) { expect("evict: " + objectToEvict); } public void evict(Object objectToEvict) { encounter("evict: " + objectToEvict); } public boolean isClosed() { return false; } public void close() {} public Transaction currentTransaction() { return null; } public void evictAll(Object[] os) {} public void evictAll(Collection c) {} public void evictAll() {} public void refresh(Object o) {} public void refreshAll(Object[] os) {} public void refreshAll(Collection c) {} public void refreshAll() {} public Query newQuery() { return null; } public Query newQuery(Object o) { return null; } public Query newQuery(String s, Object o) { return null; } public Query newQuery(Class c) { return null; } public Query newQuery(Extent e) { return null; } public Query newQuery(Class cl, Collection co) { return null; } public Query newQuery(Class c, String s) { return null; } public Query newQuery(Class cl, Collection co, String s) { return null; } public Query newQuery(Extent e, String s) { return null; } public Extent getExtent(Class s, boolean b) { return null; } public Object getObjectById(Object o, boolean b) { return null; } public Object getObjectId(Object o) { return null; } public Object getTransactionalObjectId(Object o) { return null; } public Object newObjectIdInstance(Class c, String s) { return null; } public void makePersistent(Object o) {} public void makePersistentAll(Object[] os) {} public void makePersistentAll(Collection c) {} public void deletePersistent(Object o) {} public void deletePersistentAll(Object[] os) {} public void deletePersistentAll(Collection c) {} public void makeTransient(Object o) {} public void makeTransientAll(Object[] os) {} public void makeTransientAll(Collection c) {} public void makeTransactional(Object o) {} public void makeTransactionalAll(Object[] os) {} public void makeTransactionalAll(Collection c) {} public void makeNontransactional(Object o) {} public void makeNontransactionalAll(Object[] os) {} public void makeNontransactionalAll(Collection c) {} public void retrieve(Object o) {} public void retrieveAll(Collection c) {} public void retrieveAll(Collection c, boolean b) {} public void retrieveAll(Object[] o) {} public void retrieveAll(Object[] os, boolean b) {} public void setUserObject(Object o) {} public Object getUserObject() { return null; } public PersistenceManagerFactory getPersistenceManagerFactory() { return null; } public Class getObjectIdClass(Class c) { return null; } public void setMultithreaded(boolean b) {} public boolean getMultithreaded() { return false; } public void setIgnoreCache(boolean b) {} public boolean getIgnoreCache() { return false; } } |
From: Walter v. I. <it...@us...> - 2004-09-20 08:25:55
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2618/src/net/sourceforge/javamatch/engine Modified Files: MatchEngine.java Added Files: JDOMatchEngine.java Log Message: Added (unoptimized) JDO implementation Index: MatchEngine.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/MatchEngine.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MatchEngine.java 14 Sep 2004 13:29:25 -0000 1.5 --- MatchEngine.java 20 Sep 2004 08:25:46 -0000 1.6 *************** *** 136,141 **** * Retrieves and returns the object or object with the given identifier from * the underlying persistent storage mechanism, if any. By default, returns ! * the same object. This method notifies the registered listeners that the ! * object has been retrieved * @param objectToRetrieve the object or object identifier to retrieve * @return the object that is retrieved --- 136,140 ---- * Retrieves and returns the object or object with the given identifier from * the underlying persistent storage mechanism, if any. By default, returns ! * the same object. * @param objectToRetrieve the object or object identifier to retrieve * @return the object that is retrieved *************** *** 151,156 **** * Discards the given object from memory. After discarding, the match engine * will not call this object again (the calling application might still do ! * so, but that's up to that application. This method notifies the ! * registered listeners that the object is about to be discarded * @param objectToDiscard the object to discard */ --- 150,154 ---- * Discards the given object from memory. After discarding, the match engine * will not call this object again (the calling application might still do ! * so, but that's up to that application. * @param objectToDiscard the object to discard */ --- NEW FILE: JDOMatchEngine.java --- /* JavaMatch: Matching engine for Java runtime data structures * Copyright (C) 2004 Walter van Iterson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.javamatch.engine; import net.sourceforge.javamatch.query.*; import java.util.*; import javax.jdo.*; /** * Class JDOMatchEngine provides the match engine functionality, especially * targeted at JDO implementations */ public class JDOMatchEngine extends MatchEngine { /** The persistance manager, that manges object persistence */ private PersistenceManager persistenceManager; /** * Creates an ew JDOMatchEngine, that uses the given persistenceManager for * managing object persistence * @param persistenceManager the persistence manager */ public JDOMatchEngine(PersistenceManager persistenceManager) { if (persistenceManager == null) { throw new NullPointerException("Can't create JDOMatchEngine without " + "persistence manager"); } this.persistenceManager = persistenceManager; } /** * Executes the specified match query on all objects in the given Extent. * Returns a MatchResult, that contains the best matching items with their * match value. * @param query the query that is executed * @param extent the extent that contains the items to be matched * @return a MatchResult, that contains the best matching ResultItems * @throws MatchException when matching failed */ public MatchResult executeQuery(MatchQuery query, Extent extent) throws MatchException { if (extent == null) { throw new NullPointerException("Match engine can't execute a query " + "on a null extent"); } Iterator iterator1 = extent.iterator(); Iterator iterator2 = extent.iterator(); try { return executeQuery(query, iterator1, iterator2); } finally { extent.close(iterator1); extent.close(iterator2); } } /** * Discards the given object from memory. After discarding, the match engine * will not call this object again (the calling application might still do * so, but that's up to that application. * @param objectToDiscard the object to discard */ protected void discardObject(Object objectToDiscard) { // Give a hint to the persistence manager that this object isn't used // any more persistenceManager.evict(objectToDiscard); } } |
From: Walter v. I. <it...@us...> - 2004-09-20 08:25:55
|
Update of /cvsroot/javamatch/javamatch/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2618/lib Added Files: jdo.jar Log Message: Added (unoptimized) JDO implementation --- NEW FILE: jdo.jar --- (This appears to be a binary file; contents omitted.) |
From: Walter v. I. <it...@us...> - 2004-09-20 08:25:54
|
Update of /cvsroot/javamatch/javamatch/docs/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2618/docs/website Modified Files: javamatch.xml Log Message: Added (unoptimized) JDO implementation Index: javamatch.xml =================================================================== RCS file: /cvsroot/javamatch/javamatch/docs/website/javamatch.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** javamatch.xml 14 Sep 2004 13:42:34 -0000 1.11 --- javamatch.xml 20 Sep 2004 08:25:45 -0000 1.12 *************** *** 460,463 **** --- 460,476 ---- JavaMatch works in combination with such storage mechanisms. </p> + <h2>JDO</h2> + <p class="intro"><a href="http://www.jdocentral.com">JDO</a>, the standard for + transparent object persistence, enables you to match in databases. JDO has a + query language, JDOQL. This language can be used to improve JavaMatch's + performance in two different ways: + </p> + <ul> + <li>Translate the subqueries into JDOQL, to reduce the amount of objects + that are iterated during the matching. This can only be done for those queries that + have a corresponding JDOQL operator</li> + <li>Use JDOQL's min and max operators for Minimum and Maximum-queries, to avoid + the pre-pass iteration. (This is a JDO 2.0 feature)</li> + </ul> <h2><a name="prevayler"/>Prevayler</h2> <p class="intro"> *************** *** 540,543 **** --- 553,557 ---- of the duration of all projects that had something to do with Java technology)</li> + <li><a href="integration.html#jdo">Performance optimizations</a> for JDO</li> </ul> </td> *************** *** 565,568 **** --- 579,586 ---- </tr> <tr> + <td>20040914</td> + <td>Restructured the web site</td> + </tr> + <tr> <td>20040913</td> <td>Replaced MatchList, OrList, AndList with QuerySet. Added RegexMatches, *************** *** 628,632 **** <li>LessThan(300) returns a complete mismatch both for 301 and 10000</li> <li>Range(10, 20) might have a "preferred" value at 16</li> - <li>Regular expression match queries</li> </ul> <h3>Web site</h3> --- 646,649 ---- |
From: Walter v. I. <it...@us...> - 2004-09-20 08:25:54
|
Update of /cvsroot/javamatch/javamatch In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2618 Modified Files: build.xml Log Message: Added (unoptimized) JDO implementation Index: build.xml =================================================================== RCS file: /cvsroot/javamatch/javamatch/build.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** build.xml 13 Sep 2004 07:17:36 -0000 1.3 --- build.xml 20 Sep 2004 08:25:44 -0000 1.4 *************** *** 6,10 **** <!--*************************************************************************--> <property name="lib_junit" value="lib/junit3.8.1.jar"/> ! <property name="lib" value="${lib_junit}"/> <!--*************************************************************************--> --- 6,11 ---- <!--*************************************************************************--> <property name="lib_junit" value="lib/junit3.8.1.jar"/> ! <property name="lib_jdo" value="lib/jdo.jar"/> ! <property name="lib" value="${lib_junit}:${lib_jdo}"/> <!--*************************************************************************--> |
From: Walter v. I. <it...@us...> - 2004-09-14 13:42:44
|
Update of /cvsroot/javamatch/javamatch/docs/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27345/docs/website Modified Files: javamatch.xml Log Message: Restructured website Index: javamatch.xml =================================================================== RCS file: /cvsroot/javamatch/javamatch/docs/website/javamatch.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** javamatch.xml 13 Sep 2004 13:39:22 -0000 1.10 --- javamatch.xml 14 Sep 2004 13:42:34 -0000 1.11 *************** *** 23,66 **** matching objects. </p> ! <h2>Example 1: Queries</h2> <p> Nice those stories, but how does it work in practice? Let me give you an example: </p> <p> ! Suppose you have a data structure that maintains a list of camp sites, with the ! facilities they provide. With JavaMatch, your web site can offer a "detailed ! search" feature, where a user can specify which one of the facilities he wants or ! doesn't want on the site. ! </p> ! <p> ! Let's assume a user wants to look for a small, cheap camp site with a swimming pool. ! The following code defines and executes this match query: ! </p> ! <pre class="source">QuerySet query = new QuerySet(); ! query.addPreferred(new LessThan("size", 100)); ! query.addPreferred(new NumberEquals("distanceToSwimmingPool", 0)); ! query.addPreferred(new Minimum("priceIndication")); ! ! List campSites = guide.getCampSites(); ! MatchResult matchResult = matchEngine.executeQuery(query, campSites);</pre> ! <p> ! Class MatchResult contains a list of ResultItem's. A ResultItem consists of a ! matchedObject, the object that was matched, and a matchValue, an indication of how ! good this object matches the specified criteria). The ResultItems are sorted in ! decreasing order by their matchValue, so the best matching object is the first one ! in the list. ! </p> ! <p> ! The full source can be found in the directory examples/camping in the distribution </p> - <h2>Example 2: Results and extensions</h2> - <p> - The JavaMatch engine is domain-independent, so if I want to look for a certain - second-hand car, I can specify the following query: - </p> <pre class="source">QuerySet query = new QuerySet(); query.addRequired(new StringEquals("brand", "BMW")); - query.addPreferred(new Range("buildYear", 1997, 2002)); query.addPreferred(new LessThan("price", 10000)); query.addPreferred(new LessThan("mileage", 80000)); --- 23,40 ---- matching objects. </p> ! <h2>Example: Queries</h2> <p> Nice those stories, but how does it work in practice? Let me give you an example: </p> <p> ! Let's suppose there is an application that keeps an inventory of used cars. ! This application has a class <i>Car</i>, with methods <i>getBrand()</i>, ! <i>getPrice()</i>, ... to retrieve the brand, price, .... <br/> ! If I want to find a certain car, I can specify the following query: </p> <pre class="source">QuerySet query = new QuerySet(); query.addRequired(new StringEquals("brand", "BMW")); query.addPreferred(new LessThan("price", 10000)); + query.addPreferred(new Range("buildYear", 1997, 2002)); query.addPreferred(new LessThan("mileage", 80000)); *************** *** 126,165 **** <p> As you can see in row 1 to 3, the match engine first returns the objects that ! exactly match the criteria. This is similar to the rows you'll get when you ! execute an SQL query. Row 4 to 6 are different: they show the objects that don't match <b>exactly</b>, but the objects that <b>best</b> match the query. </p> <hr/> ! <h3>Extensions</h3> <p> ! You may want to find a match with more complicated, domain-specific criteria, ! for example if the car has had regular service intervals. In this case, you can ! create your own queries by extending class MatchQuery, or one of its subclasses. ! All you have to do is provide an implementation of <i>getMatchValue</i>, and your ! query can be part of the matching process. ! </p> ! <pre class="source"><i>/** ! * Class RegularServiceIntervals a query to be used by JavaMatch, ! * that checks if a Car has has been services frequently ! */</i> ! public class RegularServiceIntervals <b>extends MatchQuery</b> { ! <i>/** ! * Calculates the regularity of the service intervals ! * @param matchedObject the car from which the service intervals ! * are checked ! * @return an indicator for how regular the car was serviced ! */</i> ! <b>public float getMatchValue(Object matchedObject) ! throws MatchException {</b> ! Car carToMatch = (Car)matchedObject; ! List services = carToMatch.getServices(); ! ... ! <i>// calculate and return a value (from 0 to 1, both inclusive) ! // for how regular the services took place</i> ! } ! }</pre> ! <p> ! More information about extensions can be found in the docs directory in the distribution ! </p> </page> <page title="Download/Installation" filebase="download"> --- 100,129 ---- <p> As you can see in row 1 to 3, the match engine first returns the objects that ! exactly match the criteria. This is the same data that you get when you execute ! a similar SQL query. Row 4 to 6 are different: they show the objects that don't match <b>exactly</b>, but the objects that <b>best</b> match the query. </p> <hr/> ! <h2>What's more?</h2> ! <p>The queries that you see in the example above are just a small subset of the ! queries that JavaMatch provides. In the <a href="docs.html">documentation</a> ! section, you'll find the following different kinds of queries: ! </p> ! <ul> ! <li><a href="docs.html#hierarchy">Queries</a>: Various string, number and boolean ! queries</li> ! <li><a href="docs.html#relative">Relative matching</a>: Finding minimum and maximum ! values in the data set</li> ! <li><a href="docs.html#queryset">QuerySets</a>: Used to merge multiple required and/or ! preferred subqueries</li> ! <li><a href="docs.html#extensions">Extensions</a>: Defining custom queries</li> ! </ul> <p> ! Other features provided by JavaMatch are: ! </p> ! <ul> ! <li><a href="docs.html#custom">Customizing</a> the output</li> ! <li><a href="integration.html">Integration</a> with other tools</li> ! </ul> </page> <page title="Download/Installation" filebase="download"> *************** *** 221,224 **** --- 185,189 ---- <p>If you compare the functionality of JavaMatch with SQL, you'll see a couple of differences: + </p> <ul> <li>SQL is row-based, JavaMatch is object-oriented</li> *************** *** 233,237 **** matching in the Java runtime environment</li> </ul> - </p> <h3>What is JavaMatch, compared to my own search algorithm?</h3> <p> --- 198,201 ---- *************** *** 273,301 **** be completed and structured before release 1.0 </div> <p> ! You can browse the <a href="api/index.html" target="_black">API documentation</a> online. </p> <h2>Matching algorithm</h2> <p>The current matching algorithm uses the concept of a <i>query</i> and a list of <i>objects</i> that the query operates on. A typical query is something like <pre> If method <m> in object <o> returns a value less than <v> , there is a match". </pre> When a query is executed, it returns a value from 0 to 1, both inclusive. A 1 means a 100% match, while a 0 return value means a total mismatch. </p> <p> ! Queries may be combined by using QuerySet-queries. A QuerySet has a list of required ! and a list of preferred subqueries. When all required subqueries match completely, ! the object that best matches most preferred subqueries returns the highest match value. </p> ! <h3>Two-pass queries</h3> Some queries, such as Minimum and Maximum, compare an object against all other objects ! in the object list. These queries are called two-pass queries. In the first pass, ! the relevant data (global minimum and maximum) is calculated. In the second pass, this data is used to calculate the match value. As the name implies, the data is passed twice. This means more communication overhead when the data is retrieved from a large database. ! <h2>Match query hierarchy</h2> ! <img src="images/hierarchy.png" alt="Match hierarchy"/> <h2>Related technology</h2> <h3>Matching engines</h3> --- 237,360 ---- be completed and structured before release 1.0 </div> + <h2>API Documentation</h2> <p> ! You can browse the <a href="api/index.html">API documentation</a> online. It can also ! be generated from the <a href="http://sourceforge.net/project/showfiles.php?group_id=116811"> ! distribution</a>. </p> <h2>Matching algorithm</h2> <p>The current matching algorithm uses the concept of a <i>query</i> and a list of <i>objects</i> that the query operates on. A typical query is something like + </p> <pre> If method <m> in object <o> returns a value less than <v> , there is a match". </pre> + <p> When a query is executed, it returns a value from 0 to 1, both inclusive. A 1 means a 100% match, while a 0 return value means a total mismatch. </p> + <h3><a name="queryset"/>QuerySets</h3> <p> ! Queries may be combined by using QuerySet-queries.<br/> ! A QuerySet maintains two different lists: A list of <b>required</b> subqueries ! and a list of <b>preferred</b> subqueries. During the matching, all required ! subqueries are first evaluated. When the required subqueries <i>don't</i> match ! completely, the match is considered a mismatch. When the required queries <i>do</i> ! match completely, the preferred subqueries are also evaluated. The match value of ! the QuerySet is calculated by taking the (weighted) average of all subqueries. ! This algorithm returns the highest match value (the highest relative ranking) ! for those objects that have the most / best matching subqueries. </p> ! <p> ! A QuerySet is also a MatchQuery. This way, QuerySets may be nested. Escpecially ! when nesting QuerySets, you might want to provide different weights for the nested ! subqueries: ! </p> ! <pre class="source">query.addPreferred(nestedQuery, 4f);</pre> ! <h2><a name="hierarchy"/>Match query hierarchy</h2> ! <map id="hierarchyMap" name="hierarchyMap"> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/RegexMatches.html" alt="RegexMatches" coords="253,265 367,265 367,217 253,217 253,265"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/BooleanEquals.html" alt="BooleanEquals" coords="0,157 121,157 121,109 0,109 0,157"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/NotQuery.html" alt="NotQuery" coords="262,157 352,157 352,109 262,109 262,157"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/LessThan.html" alt="LessThan" coords="589,374 674,374 674,325 589,325 589,374"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/GreaterThan.html" alt="GreaterThan" coords="457,374 565,374 565,325 457,325 457,374"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/NumberEquals.html" alt="NumberEquals" coords="229,374 349,374 349,325 229,325 229,374"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/Maximum.html" alt="Maximum" coords="121,374 205,374 205,325 121,325 121,374"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/Range.html" alt="Range" coords="373,374 433,374 433,325 373,325 373,374"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/Minimum.html" alt="Minimum" coords="12,374 97,374 97,325 12,325 12,374"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/StringEquals.html" alt="StringEquals" coords="121,265 229,265 229,217 121,217 121,265"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/Contains.html" alt="Contains" coords="12,265 97,265 97,217 12,217 12,265"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/StringQuery.html" alt="StringQuery" coords="133,157 241,157 241,109 133,109 133,157"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/MatchQuery.html" alt="MatchQuery" coords="247,49 355,49 355,0 247,0 247,49"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/QuerySet.html" alt="QuerySet" coords="517,157 601,157 601,109 517,109 517,157"/> ! <area shape="poly" href="api/net/sourceforge/javamatch/query/NumericQuery.html" alt="NumericQuery" coords="373,157 493,157 493,109 373,109 373,157"/> ! </map> ! <img src="images/hierarchy.png" alt="Match hierarchy" usemap="#hierarchyMap"/> ! <h2><a name="relative"/>Relative matching</h2> ! <p> Some queries, such as Minimum and Maximum, compare an object against all other objects ! in the object list. An example of a two-pass query: ! </p> ! <p> ! Let's assume a user wants to look for a small, cheap camp site with a swimming pool. ! The following code defines and executes this match query: ! </p> ! <pre class="source">QuerySet query = new QuerySet(); ! query.addPreferred(new LessThan("size", 100)); ! query.addPreferred(new NumberEquals("distanceToSwimmingPool", 0)); ! query.addPreferred(new Minimum("priceIndication")); ! ! List campSites = guide.getCampSites(); ! MatchResult matchResult = matchEngine.executeQuery(query, campSites);</pre> ! <p> ! The full source of this example can be found in the directory examples/camping in ! the distribution ! </p> ! <p> ! This kind of queries is called a two-pass query. In the first pass, the relevant data ! (global minimum and maximum for the price) is calculated. In the second pass, this data is used to calculate the match value. As the name implies, the data is passed twice. This means more communication overhead when the data is retrieved from a large database. ! </p> ! <h2><a name="extensions"/>Extensions</h2> ! <p> ! You may want to find a match with more complicated, domain-specific criteria, ! for example if the car has had regular service intervals. In this case, you can ! create your own queries by extending class MatchQuery, or one of its subclasses. ! All you have to do is provide an implementation of <i>getMatchValue</i>, and your ! query can be part of the matching process. ! </p> ! <pre class="source"><i>/** ! * Class RegularServiceIntervals a query to be used by JavaMatch, ! * that checks if a Car has has been services frequently ! */</i> ! public class RegularServiceIntervals <b>extends MatchQuery</b> { ! <i>/** ! * Calculates the regularity of the service intervals ! * @param matchedObject the car from which the service intervals ! * are checked ! * @return an indicator for how regular the car was serviced ! */</i> ! <b>public float getMatchValue(Object matchedObject) ! throws MatchException {</b> ! Car carToMatch = (Car)matchedObject; ! List services = carToMatch.getServices(); ! ... ! <i>// calculate and return a value (from 0 to 1, both inclusive) ! // for how regular the services took place</i> ! } ! }</pre> ! <h2><a name="custom"/>Output customization</h2> ! There are several ways to customize JavaMatch's output. These customizations are ! performed on the match engine (class <code>net.sourceforge.javamatch.engine.MatchEngine</code>). ! <hr/> ! <h3>Number of returned results</h3> ! To change the number of results that are returned by JavaMatch, you can call ! <pre class="source">matchEngine.setMaxNumResultItems(<i><number of items></i>);</pre> ! <hr/> ! <h3>Match threshold</h3> ! You might want to specify a threshold value: a minimum value before an object is ! added to the result. This can be done by calling ! <pre class="source">matchEngine.setThreshold(<i><threshold value></i>);</pre> <h2>Related technology</h2> <h3>Matching engines</h3> *************** *** 324,331 **** </ul> <h2>Other technologies in depth</h2> ! <a name="sodaquery"/> ! <h3>SodaQuery</h3> <p> ! SODAQuery project summary:<br/> <i>S.O.D.A. is a an object API to communicate with databases. The current specification is focussed on queries. Goals are: type safety, object reuse, --- 383,389 ---- </ul> <h2>Other technologies in depth</h2> ! <h3><a name="sodaquery"/>SodaQuery</h3> <p> ! <a href="http://sodaquery.sourceforge.net">SODAQuery</a> project summary:<br/> <i>S.O.D.A. is a an object API to communicate with databases. The current specification is focussed on queries. Goals are: type safety, object reuse, *************** *** 333,338 **** </p> <p> ! The main differences and similarities between JavaMatch and ! <a href="http://sodaquery.sourceforge.net">SODAQuery</a> are: </p> <p> --- 391,395 ---- </p> <p> ! The main differences and similarities between JavaMatch and SODAQuery are: </p> <p> *************** *** 403,407 **** JavaMatch works in combination with such storage mechanisms. </p> ! <a name="prevayler"/><h2>Prevayler</h2> <p class="intro"> <a href="http://www.prevayler.org">Prevayler</a> does not use a database. It keeps the entire --- 460,464 ---- JavaMatch works in combination with such storage mechanisms. </p> ! <h2><a name="prevayler"/>Prevayler</h2> <p class="intro"> <a href="http://www.prevayler.org">Prevayler</a> does not use a database. It keeps the entire |
From: Walter v. I. <it...@us...> - 2004-09-14 13:42:44
|
Update of /cvsroot/javamatch/javamatch/docs/website/resources/style In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27345/docs/website/resources/style Modified Files: style.css Log Message: Restructured website Index: style.css =================================================================== RCS file: /cvsroot/javamatch/javamatch/docs/website/resources/style/style.css,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** style.css 10 Sep 2004 13:00:40 -0000 1.3 --- style.css 14 Sep 2004 13:42:34 -0000 1.4 *************** *** 16,34 **** } - td.disclaimer { - border: 0px; - background-color: rgb(102, 51, 51); - } - - div.disclaimer { - font-size: 130%; - font-family: Arial,Helvetica,Univers,Zurich BT,sans-serif; - color: white; - padding: 10px; - border: 5px dotted rgb(255, 204, 102); - background-color: rgb(102, 51, 51); - margin: 20px; - } - div.intro { font-style: italic; --- 16,19 ---- |
From: Walter v. I. <it...@us...> - 2004-09-14 13:42:44
|
Update of /cvsroot/javamatch/javamatch/docs/website/resources/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27345/docs/website/resources/images Modified Files: hierarchy.png Log Message: Restructured website Index: hierarchy.png =================================================================== RCS file: /cvsroot/javamatch/javamatch/docs/website/resources/images/hierarchy.png,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsmLzPHM and /tmp/cvsR46WZl differ |
From: Walter v. I. <it...@us...> - 2004-09-14 13:42:44
|
Update of /cvsroot/javamatch/javamatch/docs/website/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27345/docs/website/templates Modified Files: page.vm Log Message: Restructured website Index: page.vm =================================================================== RCS file: /cvsroot/javamatch/javamatch/docs/website/templates/page.vm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** page.vm 13 Sep 2004 07:17:37 -0000 1.4 --- page.vm 14 Sep 2004 13:42:35 -0000 1.5 *************** *** 8,19 **** #end - #macro ( writeDisclaimer ) - <tr><td class="disclaimer" colspan="2"> - <div class="disclaimer"> - WARNING! This engine is in a very early stage. The API is still very likely to change. - </div> - </td></tr> - #end - #macro ( makeProject ) #set ($pages = $xpath.applyTo("document/page", $root)) --- 8,11 ---- *************** *** 30,34 **** hosted by <a href="http://sourceforge.net/projects/javamatch"> ! <img src="http://sourceforge.net/sflogo.php?group_id=116811&type=1" width="88" height="31" border="0" alt="SourceForge.net"/> </a> </p> --- 22,26 ---- hosted by <a href="http://sourceforge.net/projects/javamatch"> ! <img src="http://sourceforge.net/sflogo.php?group_id=116811&type=1" width="88" height="31" alt="SourceForge.net"/> </a> </p> *************** *** 65,69 **** </td> </tr> - #writeDisclaimer() <tr> <!-- NAVIGATION BAR --> --- 57,60 ---- |
From: Walter v. I. <it...@us...> - 2004-09-14 13:42:42
|
Update of /cvsroot/javamatch/javamatch/docs/assets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27345/docs/assets Modified Files: Match Hierarchy.vsd Log Message: Restructured website Index: Match Hierarchy.vsd =================================================================== RCS file: /cvsroot/javamatch/javamatch/docs/assets/Match Hierarchy.vsd,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsVKn4jf and /tmp/cvshSTw9N differ |
From: Walter v. I. <it...@us...> - 2004-09-14 13:29:37
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25182/net/sourceforge/javamatch/engine Modified Files: MatchEngine.java Log Message: Added setMaxNumResultItems Index: MatchEngine.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/MatchEngine.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MatchEngine.java 13 Sep 2004 09:14:11 -0000 1.4 --- MatchEngine.java 14 Sep 2004 13:29:25 -0000 1.5 *************** *** 112,115 **** --- 112,126 ---- } + /** + * The maximum number of result items to be returned in a query + */ + public void setMaxNumResultItems(int maxNumResultItems) { + if (maxNumResultItems < 0) { + throw new IllegalArgumentException("Can't set a negative number " + + "of result items"); + } + this.maxNumResultItems = maxNumResultItems; + } + /** * Sets the threshold value, the minimum value that each sub-query shoud have, |
From: Walter v. I. <it...@us...> - 2004-09-14 13:29:36
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25182/net/sourceforge/javamatch/engine/test Modified Files: MatchEngineTest.java Log Message: Added setMaxNumResultItems Index: MatchEngineTest.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/engine/test/MatchEngineTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MatchEngineTest.java 13 Sep 2004 09:14:11 -0000 1.4 --- MatchEngineTest.java 14 Sep 2004 13:29:25 -0000 1.5 *************** *** 208,210 **** --- 208,243 ---- } } + + public void testSetNegativeMaxNumResultItems() { + MatchEngine engine = new MatchEngine(); + try { + engine.setMaxNumResultItems(-1); + fail("Shouldn't be able to set a negative number of result items"); + } catch (IllegalArgumentException iae) { + // should occur + } + } + + public void testSetMaxNumResultItems() { + try { + MatchEngine engine = new MatchEngine(); + engine.setMaxNumResultItems(3); + MatchQuery query = new ObjectValueQuery("floatValue"); + Vector objects = new Vector(); + objects.add(new DataObject(0.0f)); + objects.add(new DataObject(0.1f)); + objects.add(new DataObject(0.2f)); + objects.add(new DataObject(0.3f)); + objects.add(new DataObject(0.4f)); + objects.add(new DataObject(0.5f)); + MatchResult result = engine.executeQuery(query, objects); + Iterator resultIterator = result.getResultIterator(); + assertEquals(0.5f, ((ResultItem)resultIterator.next()).getMatchValue(), 0.001f); + assertEquals(0.4f, ((ResultItem)resultIterator.next()).getMatchValue(), 0.001f); + assertEquals(0.3f, ((ResultItem)resultIterator.next()).getMatchValue(), 0.001f); + assertFalse(resultIterator.hasNext()); + } catch (MatchException me) { + fail("unable to match"); + } + } } |
From: Walter v. I. <it...@us...> - 2004-09-14 06:59:47
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/query/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23954/src/net/sourceforge/javamatch/query/test Modified Files: QuerySetTest.java Log Message: Also count-in required subqueries when calculating the weight Index: QuerySetTest.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/query/test/QuerySetTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QuerySetTest.java 13 Sep 2004 13:39:24 -0000 1.2 --- QuerySetTest.java 14 Sep 2004 06:59:37 -0000 1.3 *************** *** 100,104 **** curQuery.addRequired(new ConstantMatch(1.0f)); curQuery.addPreferred(new ConstantMatch(0.3f)); ! assertEquals(0.3f, curQuery.getMatchValue(new Object()), 0.01f); } catch (MatchException me) { fail("unable to match"); --- 100,104 ---- curQuery.addRequired(new ConstantMatch(1.0f)); curQuery.addPreferred(new ConstantMatch(0.3f)); ! assertEquals(0.15f, curQuery.getMatchValue(new Object()), 0.01f); } catch (MatchException me) { fail("unable to match"); |
From: Walter v. I. <it...@us...> - 2004-09-14 06:59:46
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/query In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23954/src/net/sourceforge/javamatch/query Modified Files: QuerySet.java Log Message: Also count-in required subqueries when calculating the weight Index: QuerySet.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/query/QuerySet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QuerySet.java 13 Sep 2004 13:39:23 -0000 1.2 --- QuerySet.java 14 Sep 2004 06:59:37 -0000 1.3 *************** *** 138,142 **** } } ! float totalWeight = 0; float totalMatchValue = 0; queryIterator = preferredQueries.iterator(); --- 138,142 ---- } } ! float totalWeight = requiredQueries.size(); float totalMatchValue = 0; queryIterator = preferredQueries.iterator(); |