Skip to content

Commit

Permalink
Higher disambiguation limit
Browse files Browse the repository at this point in the history
This limit raise allows disambiguate_FailWithYearSuffix to pass

cf. #199
  • Loading branch information
reknih committed Oct 10, 2024
1 parent 9e30220 commit 298e5d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/csl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl<'a, T: EntryLike + Hash + PartialEq + Eq + Debug> BibliographyDriver<'a, T>
//
// If we have set the disambiguation state for an item, we need to set
// the same state for all entries referencing that item.
for _ in 0..6 {
for _ in 0..16 {
let ambiguous = find_ambiguous_sets(&res);
if ambiguous.is_empty() {
break;
Expand All @@ -227,17 +227,21 @@ impl<'a, T: EntryLike + Hash + PartialEq + Eq + Debug> BibliographyDriver<'a, T>
.or_insert(state);
};

eprintln!("Disambiguation loop");

for group in ambiguous.iter() {
// 2a. Name Disambiguation loop
disambiguate_names(&res, group, |entry, state| {
mark(&mut rerender, entry, state)
mark(&mut rerender, entry, dbg!(state))
});

// Do not try other methods if the previous method succeeded.
if !rerender.is_empty() {
continue;
}

eprintln!("Beyond names");

// 2b. Disambiguate by allowing `cs:choose` disambiguation.
disambiguate_with_choose(&res, group, |entry, state| {
mark(&mut rerender, entry, state)
Expand Down
1 change: 1 addition & 0 deletions tests/citeproc-pass.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ disambiguate_ByCiteTwoAuthorsSameCite
disambiguate_ByCiteTwoAuthorsSameFamilyName
disambiguate_DifferentSpacingInInitials
disambiguate_DisambiguateTrueAndYearSuffixOne
disambiguate_FailWithYearSuffix
disambiguate_FamilyNameOnly
disambiguate_LastOnlyFailWithByCite
disambiguate_NoTextElementUsesYearSuffixVariable
Expand Down

0 comments on commit 298e5d5

Please sign in to comment.