Element Scoring

Scoring configuration is done with the help of pseudo inputs that are to be used in any of the expressions that the Scoring provides. The pseudo inputs are as follows:

Each pseudo-input except the const input includes address components, which are declared in the reference data configuration. Moreover, there is a component called unexpl in the pa input, whose value returns unexplained text.

Name

Type

Required

Description

When

String

Yes

Determines when score and explanation values are written into the resulting score. Default value: None.

Score

String

Yes

Integer expression whose result is added to the score column after accomplishing the when condition. Caution: if the scoring for the input address evaluates to null, the overall scoring is also null. Default value: None.

Explanation

String

Yes

String expression whose result is appended to the explanation column after accomplishing the when condition. Unlike the score property, this expression may evaluate to null in which cases the "null" string is appended to the result to emphasize that such scoring was effective. Default value: None.



Example: Example
<Scoring>
  <explanation>'ulice_Novakova'</explanation>
  <score>666</score>
  <when>ia.ulice == 'Novakova'</when>
</Scoring>
If there is street called ‘Novakovatm) in the input it will add the score 666 and append the text 'ulice_Novakova'.
<Scoring>
  <explanation>'prop_obec_Kocourkov'</explanation>
  <score>12347</score>
  <when>pa.obec == 'Kocourkov'</when>
</Scoring>
If there is city called ‘kocourkovtm) in the proposal it will add the score 12347 and append the text 'prop_obec_Kocourkov'
<Scoring>
  <explanation>'po_MISSING'</explanation>
  <score>10</score>
  <when>expl.po == const.missing</when>
</Scoring>
If the post name is missing it will add the score 10 and append the text 'po_MISSING
<Scoring>
  <explanation>'ulice_APPROX_E_' + toString(e.ulice)</explanation>
  <score>10</score>
  <when>e.ulice > 0</when>
</Scoring>
If the street is found with an approximate name it will add the score 10 and append the text 'ulice_APPROX_E_(count of different chars)
<Scoring>
  <explanation>'ulice_APPROX_Z_' + toString(z.ulice)</explanation>
  <score>10</score>
  <when>z.ulice > 0</when>
</Scoring>
If the street is found with a truncated name it will add the score 10 and append the text 'ulice_APPROX_Z_(count of missing chars)
<Scoring>
  <explanation>'ulice_APPROX_D_' + toString(d.ulice)</explanation>
  <score>10</score>
  <when>d.ulice > 0</when>
</Scoring>
If the street is found with missing diacritics it will add the score 10 and append the text 'ulice_APPROX_D_(count of chars with missing diacritic)
<Scoring>
  <explanation>'UNEXPL_' + toString(pa.unexpl)</explanation>
  <score>length(pa.unexpl) * 10</score>
  <when>length(pa.unexpl) > 0</when>
</Scoring>
If there are unexplained chars it will add the score 10 * the count of unexplained chars and append the text 'unexpl_(count of unexplained chars)
<Scoring>
  <explanation>'PSC_CHARS1'</explanation>
  <score>5</score>
  <when>c.psc == 1</when>
</Scoring>
If the ZIP differs on the last character it will add the score 5 and append the text 'ZIP_CHARS1'. Exemplary configuration for Dictionary Lookup Identifier:
<scoring>
  <scoring when="expl.ulice == const.approx AND z.ulice &gt; 0" score="10" explanation="'ulice_SHORT'"/>
  <scoring when="expl.obec == const.approx AND z.obec &gt; 0" score="10" explanation="'obec_SHORT'"/>
  <scoring when="expl.cobce == const.approx AND z.cobce &gt; 0" score="10" explanation="'cobce_SHORT'"/>
  <scoring when="expl.posta == const.approx AND z.posta &gt; 0" score="10" explanation="'po_SHORT'"/>
  <scoring when="expl.okres == const.approx AND z.okres &gt; 0" score="10" explanation="'okres_SHORT'"/>
  <scoring when="expl.mcast == const.approx AND z.mcast &gt; 0" score="10" explanation="'mcast_SHORT'"/>
  <scoring when="expl.ulice == const.approx AND e.ulice &gt; 0" score="10*e.ulice" explanation="'ulice_APPROX'+toString(e.ulice)"/>
  <scoring when="expl.obec == const.approx AND e.obec &gt; 0" score="10*e.obec" explanation="'obec_APPROX'+toString(e.obec)"/>
  <scoring when="expl.cobce == const.approx AND e.cobce &gt; 0" score="10*e.cobce" explanation="'cobce_APPROX'+toString(e.cobce)"/>
  <scoring when="expl.posta == const.approx AND e.posta &gt; 0" score="10*e.posta" explanation="'po_APPROX'+toString(e.posta)"/>
  <scoring when="expl.okres == const.approx AND e.okres &gt; 0" score="10*e.okres" explanation="'okres_APPROX'+toString(e.okres)"/>
  <scoring when="expl.mcast == const.approx AND e.mcast &gt; 0" score="10*e.mcast" explanation="'mcast_APPROX'+toString(e.mcast)"/>
  <scoring when="expl.ulice == const.approx AND d.ulice &gt; 0" score="d.ulice" explanation="'ulice_DIA'+toString(d.ulice)"/>
  <scoring when="expl.obec == const.approx AND d.obec &gt; 0" score="d.obec" explanation="'obec_DIA'+toString(d.obec)"/>
  <scoring when="expl.cobce == const.approx AND d.cobce &gt; 0" score="d.cobce" explanation="'cobce_DIA'+toString(d.cobce)"/>
  <scoring when="expl.posta == const.approx AND d.posta &gt; 0" score="d.posta" explanation="'po_DIA'+toString(d.posta)"/>
  <scoring when="expl.okres == const.approx AND d.okres &gt; 0" score="d.okres" explanation="'okres_DIA'+toString(d.okres)"/>
  <scoring when="expl.mcast == const.approx AND d.mcast &gt; 0" score="d.mcast" explanation="'mcast_DIA'+toString(d.mcast)"/>
  <scoring when="expl.ulice == const.missing" score="100" explanation="'ulice_MISSING'"/>
  <scoring when="expl.cobce == const.missing AND pa.ulice == null" score="100" explanation="'cobce_missing'"/>
  <scoring when="expl.posta == const.missing AND expl.obec == const.found AND indexOf(pa.posta, pa.obec) == 0" score="0" explanation="'po_City_INCLUDED'"/>
  <scoring when="expl.posta == const.missing AND expl.obec == const.found AND pa.posta != null AND pa.posta != pa.obec" score="10" explanation="'po_missing'"/>
  <scoring when="expl.obec == const.missing AND expl.posta == const.found AND indexOf(pa.obec, pa.posta) == 0" score="0" explanation="'obec_Post_INCLUDED'"/>
  <scoring when="expl.obec == const.missing AND expl.posta == const.found AND pa.obec != null AND pa.obec != pa.posta" score="10" explanation="'city_missing'"/>
  <scoring when="expl.obec == const.missing AND expl.posta == const.missing" score="100" explanation="'City&amp;Post_missing'"/>
  <scoring when="expl.psc == const.congruity AND c.psc == 1" score="5" explanation="'psc_CHARS1'"/>
  <scoring when="expl.psc == const.congruity AND c.psc == 2" score="10" explanation="'psc_CHARS2'"/>
  <scoring when="expl.psc == const.congruity AND c.psc == 3 AND substr(v.psc, 0, 1) == '1'" score="10" explanation="'psc_CHARS3'"/>
  <scoring when="expl.psc == const.congruity AND c.psc == 3 AND substr(v.psc, 0, 1) != '1'" score="100" explanation="'psc_CHARS3'"/>
  <scoring when="expl.psc == const.congruity AND c.psc == 4" score="200" explanation="'psc_CHARS4'"/>
  <scoring when="expl.psc == const.congruity AND c.psc == 5" score="400" explanation="'psc_CHARS5'"/>
  <scoring when="length(pa.unexpl) &gt; 3" score="20*length(pa.unexpl)" explanation="'UNEXPLAINED_CHARS'"/>
  <scoring when="length(pa.unexpl) &gt; 0 AND length(pa.unexpl) &lt;= 3" score="10*length(pa.unexpl)" explanation="'UNEXPLAINED_CHARS'"/>
</scoring>

iWay Software