Return a match score between *stretch1* and *stretch2*. The result is the absolute value of the difference between the CSS numeric values of *stretch1* and *stretch2*, normalized between 0.0 and 1.0.
(self, stretch1, stretch2)
| 1400 | return 1.0 |
| 1401 | |
| 1402 | def score_stretch(self, stretch1, stretch2): |
| 1403 | """ |
| 1404 | Return a match score between *stretch1* and *stretch2*. |
| 1405 | |
| 1406 | The result is the absolute value of the difference between the |
| 1407 | CSS numeric values of *stretch1* and *stretch2*, normalized |
| 1408 | between 0.0 and 1.0. |
| 1409 | """ |
| 1410 | try: |
| 1411 | stretchval1 = int(stretch1) |
| 1412 | except ValueError: |
| 1413 | stretchval1 = stretch_dict.get(stretch1, 500) |
| 1414 | try: |
| 1415 | stretchval2 = int(stretch2) |
| 1416 | except ValueError: |
| 1417 | stretchval2 = stretch_dict.get(stretch2, 500) |
| 1418 | return abs(stretchval1 - stretchval2) / 1000.0 |
| 1419 | |
| 1420 | def score_weight(self, weight1, weight2): |
| 1421 | """ |