Skip to content

Commit

Permalink
normalize JARL summary sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
JG1VPP committed Jul 6, 2024
1 parent aafa903 commit 2b0bdf8
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/main/java/gaas/sheet/JarlDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import static gaas.sheet.JarlFactory.DOC;

import static java.text.Normalizer.Form.NFKC;
import static java.text.Normalizer.normalize;
import static java.util.stream.Collectors.joining;

/**
Expand Down Expand Up @@ -146,10 +148,24 @@ private final String preprocess() throws IOException {
final var text = source.lines().collect(joining("\n"));
final var bare = get("BARE");
final var quot = get("QUOT");
final var form = text.replaceAll(bare, quot);
final var form = normal(text).replaceAll(bare, quot);
return String.format("<%1$s>%2$s</%1$s>", DOC, form);
}

/**
* 指定された文字列を正規化します。
*
*
* @param text 文字列
*
* @return 正規化された文字列
*
* @since 2024/07/06
*/
private final String normal(String text) {
return normalize(text, NFKC);
}

/**
* ストリームから要約書類を読み取ります。
*
Expand Down

0 comments on commit 2b0bdf8

Please sign in to comment.