atrisovic / paper_analysis_toolkit

1 stars 0 forks source link

Tests for normalizeNumericalCitations #1

Open atrisovic opened 2 months ago

atrisovic commented 2 months ago

Better solution and tests for normalizeNumericalCitations.

See:


# [1-5] =====> [1],[2],[3],[4],[5]
numerical_range_citations = re.findall('\[(\d+-\d+)\]', content)

for citation in numerical_range_citations:
    n1, n2 = map(int, re.findall('(\d+)-(\d+)', citation)[0])
    if (n2 - n1 > 1000): #arbitrary thresholdß

And d5b3933ac0afe12c3f4290854bdd5c052b07b4dc