So I think the issue centers around the results the test is looking for. It looks like the test cases were built against the OpenDDR client, which is arithmetically different than the new DeviceMap client in the following ways:
-OpenDDR is using lazy pattern matching via simple string search. devicemapjava uses greedy matching (longest pattern wins) via ngram searching -Since OpenDDR is using string searching, it can hit on partial words, devicemapjava cannot since it breaks up the ngrams at word boundaries. -The test data has patterns that no longer exist Differences: devicemapjava found: 'Nokia 6630' expected: 'Nokia' devicemapjava found: 'SonyEricssonU1i' expected: 'SonyEricssonU_1' devicemapjava found: 'HTC_Touch_HD_T8282' expected: 'HTC_Touch_HD' devicemapjava found: 'HTC Desire Z' expected: 'HTC' devicemapjava found: 'SAMSUNG GT-I9100' expected: 'SAMSUNG' devicemapjava found: 'desktopDevice' expected: 'Pre/3.0' devicemapjava found: 'SAMSUNG GT-I9100' expected: 'SAMSUNG' devicemapjava found: 'desktopDevice' expected: 'Series-9200' devicemapjava found: 'HTC Wildfire_A3333' expected: 'HTC' devicemapjava found: 'desktopDevice' expected: 'SonyEricssonSK17i' devicemapjava found: 'BlackBerry 9780' expected: 'BlackBerry' devicemapjava found: 'Movistar Link' expected: 'Movistar' devicemapjava found: 'NokiaN73-1' expected: 'NokiaN73' devicemapjava found: 'Desire HD' expected: 'Desire' devicemapjava found: 'ARCHOS 101G9' expected: 'ARCHOS' devicemapjava found: 'desktopDevice' expected: 'Nokia3250' devicemapjava found: 'desktopDevice' expected: 'IM-A710K' devicemapjava found: 'HTC Legend' expected: 'HTC' devicemapjava found: 'pandigitalplnt1' expected: 'iPad' devicemapjava found: 'T-Mobile G2' expected: 'T-Mobile' Greedy matching example: "Nokia6630/1.0 (2.39.124) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1" devicemapjava: it does ngram matching, so it hits on the full pattern "nokia6630" string search client: it will hit on the first matching pattern, which is likely "nokia" in this case partial match example: "Mozilla/5.0 (Linux; Android 4.0.3; SHV-E120K Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19" devicemapjava: cannot hit on "E120" since its buried inside of an ngram string search client: it will hit on E120 regardless of its position So the main problem here is that the pattern data in OpenDDR is built around string searching and not ngram searching. Not too big of a deal, some generic fallback patterns can resolve this. As for ngram vs string search, ngram is more accurate and will not suffer from false positives (assuming the pattern index is an ngram index). I made a task to capture this: https://issues.apache.org/jira/browse/DMAP-32 ________________________________ From: Bertrand Delacretaz <[email protected]> To: [email protected]; Reza <[email protected]> Sent: Monday, September 30, 2013 8:38 AM Subject: Re: DMAP-29 tests of the devicemapjava module - many fail On Mon, Sep 30, 2013 at 2:33 PM, Reza <[email protected]> wrote: > I will take a look at it today.. Cool! Feel free to hack & fix as needed ;-) -Bertrand
