0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PDFファイルの文字誤変換

Last updated at Posted at 2020-01-19

Autosar単語帳(作業中)
https://qiita.com/kaizen_nagoya/items/0927727a94b157df2df8

macOS/bash
$ docker run -v /Users/administrator/Downloads/autosar:/tmp/docker -it kaizenjapan/autosar /bin/bash

pdfフォルダのファイルをpdftotextでtextファイルに変換した。

ptt.sh
#!/bin/bash
# https://news.mynavi.jp/article/bashonwindows-17/
# https://qiita.com/kaizen_nagoya/items/319672853519990cee42

 cd ../pdf
 for File in *; do
    case ${File##*.} in
        pdf|PDF )
            echo "Convert the PDF:" ${File}
            pdftotext -q ${File} ../text/${File}.txt ;;
        *) ;;
    esac
 done

awkで用語頻度一覧を作って、Autosar固有の用語と、変数名などで複合語になっているものを調べている。

英語(38)  複合語と複数の単語の一分類 
https://qiita.com/kaizen_nagoya/items/219fd0bde3731f0881ed#_reference-a74f084e44dee324ea1e

Autosar 単語検索 略号等
https://qiita.com/kaizen_nagoya/items/f8cb1295104b7d58363d#_reference-199074ba6a5ea96f1fe7

dWithinという用語が 103個あった。

# cd text
# grep -i dwithin *
...
AUTOSAR_TPS_GenericStructureTemplate.pdf.txt:[constr_2627] No reassigning of the same name within one LET Block dWithin
AUTOSAR_TPS_GenericStructureTemplate.pdf.txt:[constr_2577] Binding Time in Aggregation Pattern dWithin VariationPoint,
AUTOSAR_TPS_GenericStructureTemplate.pdf.txt:[constr_2578] Binding Time in Association Pattern dWithin VariationPoint,
AUTOSAR_TPS_GenericStructureTemplate.pdf.txt:[constr_2585] LifeCycleInfo shall be unambiguous dWithin one particular
...

AUTOSAR_TPS_GenericStructureTemplate.pdf ファイルを開いて Withinで検索すると、

[constr_2585] LifeCycleInfo shall be unambiguous 「Within one particular LifeCycleInfoSet lifeCycleInfo.lcObject shall be unique. This ensures that the association of a LifeCycleState to a Referrable is unambiguous.
This contraint applies for a particular point in time under consideration of the period of viability according to [TPS_GST_00244].」()

「 が dに、」がcに変換されていた。

dthe, dthisも同様。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?