GNU/Linux >> Linux の 問題 >  >> Linux

コマンドラインでの「pdfgrep」のNyLigature対応の代替手段?

私は常に「pdfgrep」を使用して、コマンドラインから複数のPDFファイル内を検索します。しかし、私は問題に遭遇しました:この合字文字「?」(https://www.compart.com/en/unicode/U+FB01を参照)。
「fi」は「fixed」という単語に含まれているため、pdfgrep -iR 'fixed point operator'で「fixedpointoperator」という用語を検索できませんでした。 。ただし、Foxit ReaderやEvinceなどのPDFリーダーでファイルを開くと、「fi」は「f」と「i」に分割されるため、検索できます。 「pdfgrep」のより信頼できる代替手段はありますか?または、エンコーディングを拡張するためのオプションキーワードが「pdfgrep」にありますか?

PDFファイルはhttp://direct.mit.edu/books/chapter-pdf/238450/9780262321037_can.pdfです。

Ubuntu 20.04、amd64、カーネルバージョンLinux5.6.0-1018-oem。 pdfgrepにはオプション--unacがあります 。ただし、sudo apt-get install pdfgrepを使用してpdfgrepをインストールすると 、コマンド--unac 「pdfgrep:コンパイル時にUNACサポートが無効になっています!」と報告されます

pdfgrep:
  Installed: 2.1.2-1build1
  Candidate: 2.1.2-1build1
  Version table:
 *** 2.1.2-1build1 500
        500 http://mirrors.huaweicloud.com/ubuntu focal/universe amd64 Packages
        100 /var/lib/dpkg/status

承認された回答:

この問題を解決するには、最初にpdftotextを使用する必要があります あなたの結紮がUTF-8の形でどのように見えるかを知るために、例えば私はこれを実行します:

pdftotext -f 11 -l 13 ~/Mathematics/Analysis/MeasureTheory.pdf text && cat text 

次のような結果が得られます

   1.6.  Infinite and σ-finite measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

それなら私はfiを知っています 実際には、端末の呼び出し音☎ですが、fiとしてレンダリングされます ブラウザで。

だから私はpdfgrepを続けます

pdfgrep --page-range=11-13 fi ~/Mathematics/Analysis/MeasureTheory.pdf

最後に、もちろん私は望ましい結果を得る:

   1.6.  Infinite and σ-finite measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
   2.4.  The general definition of the Lebesgue integral . . . . . . . . . . . . . . 118
   2.6.  Integration with respect to infinite measures . . . . . . . . . . . . . . . . 124
   3.5.  Infinite products of measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187

Linux
  1. LinuxコマンドラインでPDFを編集する

  2. Linuxコマンドラインに関する8つのヒント

  3. Vemテキストエディタ–Vimの代替コマンドレイアウト

  1. このコマンドライントリックでPDFサイズを縮小する

  2. Titan –Linux用のコマンドラインパスワードマネージャー

  3. ppl –Linux用のコマンドラインアドレスブック

  1. コマンドラインでの毎日のBashのヒント

  2. コマンドラインインターフェイスの一般仕様?

  3. 生産性を向上させるためのLinuxコマンドラインのヒント