Skip to content

Commit

Permalink
Merge pull request #311 from korpling/feature/fix-saltxml-spans
Browse files Browse the repository at this point in the history
Give correct name in xlsx importer to segmentation token.
  • Loading branch information
thomaskrause committed Sep 5, 2024
2 parents 943136d + bff645d commit 517740f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- `xlsx` importer did not give the correct node name to segmentation token. Due
to this inconsistency, span annotations on segmentation nodes where not
connected to the segmentation token.

## [0.16.0] - 2024-09-02

### Added
Expand Down
5 changes: 1 addition & 4 deletions src/exporter/exmaralda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,7 @@ impl Exporter for ExportExmaralda {
};
let doc_path = output_path.join(format!(
"{}.{extension}",
doc_name
.split(|c| c == '/' || c == '\\')
.last()
.unwrap_or(&doc_name) // This always has a last
doc_name.split(['/', '\\']).last().unwrap_or(&doc_name) // This always has a last
));
if let Some(doc_parent) = doc_path.as_path().parent() {
fs::create_dir_all(doc_parent)?;
Expand Down
2 changes: 1 addition & 1 deletion src/importer/xlsx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ impl ImportSpreadsheet {
let overlapped_base_tokens: &[String] =
&base_tokens[base_token_start..base_token_end]; // TODO check indices

let node_name = if token_annos.contains(name) {
let node_name = if name == tok_name || token_annos.contains(name) {
format!("{}#{}_{}-{}", &doc_path, tok_name, start_row, end_row_excl)
} else {
format!(
Expand Down

0 comments on commit 517740f

Please sign in to comment.