Merge branch 'r3.7'

This commit is contained in:
Victor Shcherb 2020-05-24 21:27:09 +02:00
commit beb36fdfe9
5 changed files with 103 additions and 58 deletions

View file

@ -146,7 +146,7 @@ public class SearchCoreFactory {
phrase.countUnknownWordsMatch(res);
// int cnt = resultMatcher.getCount();
List<String> ws = phrase.getUnknownSearchWords(res.otherWordsMatch);
if(!res.firstUnknownWordMatches) {
if (!res.firstUnknownWordMatches) {
ws.add(phrase.getUnknownSearchWord());
}
// publish result to set parentSearchResult before search

View file

@ -468,7 +468,7 @@ public class SearchPhrase {
prnt = prnt.parentSearchResult;
}
sp.words.addAll(0, this.words);
if(unknownWords != null) {
if (unknownWords != null) {
sp.lastUnknownSearchWordComplete = lastComplete;
for (int i = 0; i < unknownWords.size(); i++) {
if (i == 0) {
@ -477,6 +477,9 @@ public class SearchPhrase {
sp.unknownWords.add(unknownWords.get(i));
}
}
// TODO
// sp.rawUnknownSearchPhrase = rawUnknownSearchPhrase;
// sp.unknownSearchPhrase = unknownSearchPhrase;
}
return sp;
}

View file

@ -40,8 +40,9 @@ public class SearchResult {
res = ObjectType.getTypeWeight(objectType);
}
if (parentSearchResult != null) {
// 5 is a maximum type
res += parentSearchResult.getUnknownPhraseMatchWeight() / 5;
// 10 > maximum type
// res = Math.max(res,parentSearchResult.getUnknownPhraseMatchWeight()) ;
res += parentSearchResult.getUnknownPhraseMatchWeight() / 10;
}
return res;
}

View file

@ -181,9 +181,12 @@ public class SearchUICoreTest {
String present = result.toString();
//System.out.println(present);
if(!Algorithms.stringsEqual(expected, present)) {
System.out.println(String.format("Mismatch for '%s' != '%s'. Result: ", expected, present));
System.out.println(String.format("Mismatch for '%s' != '%s' (%d, %.3f, %s). Result: ", expected,
present, result.getFoundWordCount(), result.getUnknownPhraseMatchWeight(), result.objectType.toString()));
for (SearchResult r : searchResults) {
System.out.println("\t\""+r.toString()+"\",");
System.out.println(String.format("\t\"%s\",", r.toString()));
// System.out.println(String.format("\"%s\", (%d, %.3f, %s),", r.toString(),
// r.getFoundWordCount(), r.getUnknownPhraseMatchWeight(), r.objectType.toString()));
}
}
Assert.assertEquals(expected, present);

View file

@ -12,58 +12,96 @@
"phrase": "spring street",
"results": [
"Spring (Natural)",
"Spring (Spring / Natural)",
"Spring (Ice rink / Sport)",
"Spring (Bridge / Transport construction)",
"Spring Street, South Nyack",
"Spring Street, Tomkins Cove",
"Spring Street, Southfields",
"Spring Street, Hastings-on-Hudson",
"Spring Street, Pleasantville",
"Spring Street (Mount Pleasant), Hawthorne",
"Spring Street, Durland",
"Spring Street, Warwick",
"Spring Street, Nelsonville",
"Spring Street, Goshen",
"Spring Street (Little Italy), Manhattan",
"Spring Street, Maybrook",
"West Spring Street, Maybrook",
"Spring Street, South Salem",
"Spring Street, Groveville",
"Spring Street, East Middletown",
"Spring Street, Montgomery",
"Spring Street, Chelsea",
"Spring Street, Wappingers Falls",
"Spring Street, Cold Spring Harbor",
"Spring Street, Staten Island",
"Spring Street, East Meadow",
"Spring Street, Inwood",
"Spring Street, Port Jervis",
"Spring Street, Roosevelt",
"Spring Street, Pawling",
"Spring Street, Fairview",
"Spring Street (Wyandanch), Wheatley Heights",
"Spring Street, Wyandanch",
"Spring Street, East Massapequa",
"Spring Street, Ellenville",
"Spring Street, Monticello",
"Spring Street, Tillson",
"Spring Street, Port Jefferson",
"Spring Street (Smallwood), Bethel",
"Spring Street, Liberty",
"Spring Street (Livingston Manor), Rockland",
"Spring Street, Livingston Manor",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street"
"Spring (Spring / Natural)",
"Spring (Ice rink / Sport)",
"Spring (Bridge / Transport construction)",
"Spring Street, Cold Spring Harbor",
"Spring Street, South Nyack",
"Spring Street, Tomkins Cove",
"Spring Street, Southfields",
"Spring Street, Hastings-on-Hudson",
"Spring Street, Pleasantville",
"Spring Street (Mount Pleasant), Hawthorne",
"Spring Street, Durland",
"Spring Street, Warwick",
"Spring Street, Nelsonville",
"Spring Street, Goshen",
"Spring Street (Little Italy), Manhattan",
"Spring Street, Maybrook",
"West Spring Street, Maybrook",
"Spring Street, South Salem",
"Spring Street, Groveville",
"Spring Street, East Middletown",
"Spring Street, Montgomery",
"Spring Street, Chelsea",
"Spring Street, Wappingers Falls",
"Spring Street, Staten Island",
"Spring Street, East Meadow",
"Spring Street, Inwood",
"Spring Street, Port Jervis",
"Spring Street, Roosevelt",
"Spring Street, Pawling",
"Spring Street, Fairview",
"Spring Street (Wyandanch), Wheatley Heights",
"Spring Street, Wyandanch",
"Spring Street, East Massapequa",
"Spring Street, Ellenville",
"Spring Street, Monticello",
"Spring Street, Tillson",
"Spring Street, Port Jefferson",
"Spring Street (Smallwood), Bethel",
"Spring Street, Liberty",
"Spring Street (Livingston Manor), Rockland",
"Spring Street, Livingston Manor",
"Market Street, Cold Spring",
"New Street, Cold Spring",
"West Street, Cold Spring",
"Fish Street, Cold Spring",
"North Street, Cold Spring",
"Rock Street, Cold Spring",
"Stone Street, Cold Spring",
"Wall Street, Cold Spring",
"Cross Street, Cold Spring",
"Main Street, Cold Spring",
"Chestnut Street, Cold Spring",
"Furnace Street, Cold Spring",
"Garden Street, Cold Spring",
"Church Street, Cold Spring",
"Oak Street, Cold Spring",
"Cherry Street, Cold Spring",
"High Street, Cold Spring",
"Academy Street, Cold Spring",
"Haldane Street, Cold Spring",
"West Bank Street, Cold Spring",
"B Street, Cold Spring",
"West Belvedere Street, Cold Spring",
"Parrot Street, Cold Spring",
"Bank Street, Cold Spring",
"Orchard Street, Cold Spring",
"East Belvedere Street, Cold Spring",
"Pine Street, Cold Spring",
"Parsonage Street, Cold Spring",
"Hamilton Street, Cold Spring",
"Fair Street, Cold Spring",
"Cedar Street, Cold Spring",
"Flora Street, Cold Spring Harbor",
"West Main Street, Cold Spring Harbor",
"Grove Street, Cold Spring Harbor",
"Midland Street, Cold Spring Harbor",
"Rusco Street, Cold Spring Harbor",
"Main Street, Cold Spring Harbor",
"Chestnut Street, Cold Spring Harbor",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street",
"Spring Street"
],
"amenities": [
{