Skip to content

Commit 4bed506

Browse files
authored
Merge pull request #304 from korpling/feature/fix-whitespace-before-offset
Fix whitespace before offset
2 parents 1f9f5f0 + 838eadd commit 4bed506

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
- Load existing components from the backup folder instead of the actual location
1111
if a backup folder exists.
12+
- Add bug fixes for relANNIS import discovered testing the Annatto relANNIS
13+
importer.
14+
1215

1316
## [3.3.1] - 2024-06-04
1417

graphannis/src/annis/db/relannis.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ where
895895
let line = result?;
896896

897897
let id = get_field_not_null(&line, 0, "id", &corpus_tab_path)?.parse::<u32>()?;
898-
let name = get_field_not_null(&line, 1, "name", &corpus_tab_path)?;
898+
let mut name = get_field_not_null(&line, 1, "name", &corpus_tab_path)?;
899899

900900
let corpus_type = get_field_not_null(&line, 2, "type", &corpus_tab_path)?;
901901
if corpus_type == "DOCUMENT" {
@@ -908,7 +908,7 @@ where
908908
.or_insert(1);
909909
if *existing_count > 1 {
910910
let old_name = name.clone();
911-
let name = format!("{}_duplicated_document_name_{}", name, existing_count);
911+
name = format!("{}_duplicated_document_name_{}", name, existing_count).into();
912912
warn!(
913913
"duplicated document name \"{}\" detected: will be renamed to \"{}\"",
914914
old_name, name
@@ -1288,7 +1288,7 @@ where
12881288
let mut covered_text_before =
12891289
std::string::String::with_capacity(token_left_char - current_text_offset);
12901290
let mut skipped_before_token = 0;
1291-
for _ in current_text_offset..token_left_char {
1291+
for _ in current_text_offset..(token_left_char - 1) {
12921292
if let Some(c) = text_char_it.next() {
12931293
covered_text_before.push(c);
12941294
skipped_before_token += 1;

0 commit comments

Comments
 (0)