Return the query density of this match as a ratio of its length to its qmagnitude, a float between 0 and 1. A dense match has all its matched query tokens contiguous and a maximum qdensity of one. A sparse low qdensity match has some non-contiguous matched query toke
(self)
| 563 | return self.end_line - self.start_line + 1 |
| 564 | |
| 565 | def qdensity(self): |
| 566 | """ |
| 567 | Return the query density of this match as a ratio of its length to its |
| 568 | qmagnitude, a float between 0 and 1. A dense match has all its matched |
| 569 | query tokens contiguous and a maximum qdensity of one. A sparse low |
| 570 | qdensity match has some non-contiguous matched query tokens interspersed |
| 571 | between matched query tokens. An empty match has a zero qdensity. |
| 572 | """ |
| 573 | mlen = self.len() |
| 574 | if not mlen: |
| 575 | return 0 |
| 576 | qmagnitude = self.qmagnitude() |
| 577 | if not qmagnitude: |
| 578 | return 0 |
| 579 | return mlen / qmagnitude |
| 580 | |
| 581 | def idensity(self): |
| 582 | """ |
no test coverage detected