0
513 次瀏覽

我在使用 pn USFM 標記時,偶爾會發現專有名詞後面跟著一個空白。

例如:\pn Jesus \pn* 。您可以看到 Jesus 名字後面有一個空白。我該如何搜尋名字後面跟著空白的專有名詞?

當我搜尋 \pn* 時,我得到大約 7000 個結果。當我搜尋前面有空格的 \pn* 時,我得到大約 1000 個結果。然而,它發現的項目名字後面並沒有空格。這真的讓我很困惑。您有什麼建議可以搜尋這個嗎?人們會以為這應該是一個簡單的搜尋,但似乎並非如此。

機器翻譯自 English
Paratext (251 點) 提出 | 513 次瀏覽

3 個回答

0
最佳回答

The best way to search for this is with regular expressions. In the Paratext Find window paste this
regex:\s\\pn\*
You must “escape” both \ and * with a \.
I have a general solution I use on all projects, which is to never allow a space before end character tags. You can find all possible instances using this in the Paratext Find window:
regex:\s\\\+?\w+\*
You can fix them with this find and replace using RegEx Pal:
(\s)(\u200F?\\\+?([^xf]\w*|[xf]\w+)\*)
\2\1
Note that this regex excludes spaces at the ends of footnotes and cross-references. It also makes provision for the Unicode right-to-left marker (u+200F). Fixing extra spaces in RTL text is particularity difficult without this tool.

(1.8k 點) 提出

實際上,找到 \b 在 \pn 之前的最快方式是使用 Marker Inventory。勾選 show preceding marker 並按 \b 或 \pn 排序。這是一個非常實用的工具。別忘了右鍵並複製引用到列表視窗。
祝福 Shegnada

機器翻譯自 English

我想這裡對「blank space」的措辭有些混淆。
我的理解是 @Clear7419 問的是「搜尋 \pn* 前的空格」,而不是「搜尋空白行

機器翻譯自 English

@CrazyRocky You are correct, I was just searching for a blank space and not a blank line. Thanks for your helpful regular expression. Can you explain what you mean by escaping both \ and * with a \ ? I pasted the expressing but it found examples with no blanks.

來自 Regex 教程 - 字面字元和特殊字元:

因為我們想要做的不僅僅是簡單地搜尋字面文本片段,所以我們需要保留某些字元用於特殊用途。至少有 12 個字元具有特殊含義:

反斜槓 \,脫字符 ^,美元符號 $,句點或點 .,垂直線或管道符號 |,問號 ?,星號或星 *,加號 +,左括號 (,右括號 ),左方括號 [,和左花括號 {。這些特殊字元通常被稱為「元字元」。單獨使用時,它們大多數都是錯誤。

如果您想在正規表示式中將這些字元中的任何一個用作字面您需要使用反斜槓轉義它們。如果您想匹配 1+1=2,正確的正規表示式是 1\+1=2。否則,加號具有特殊含義。

在 PT 中,我們經常需要在正規表示式中使用 \,因為它對 usfms 來說非常基本。因此,要在正規表示式中搜尋 \p,您輸入 \\p。

(學習轉義是有用的,因為即使在這個論壇工具中,除非您轉義它們或使用 </> 圖標的「預格式化文本」功能,否則某些字元將不會顯示。)

機器翻譯自 English

我相信您指的是這段代碼:

我的通用表達式搜尋嵌入標記,這些標記在腳註中特別常見。例如,有效的 USFM 要求在腳註中,\pn ...\pn* 標記必須使用反斜槓後的加號字元標記為嵌入:
\f + \fr 8:5 \ft I want to put \+pn Jesus \+pn* in a footnote.\f*
在這個例子中,\+pn* 前後各有一個空格。上面的 RegexPal 代碼將找到該空格並將其移動到 \+pn* 之後。如果這導致連續兩個空格,Paratext 將自動將它們合併為一個。
正如 @Tim 所說,加號 + 必須被轉義,但在這些搜尋中它也是可選的,所以這段代碼是 \+?
希望這能回答您的問題。

機器翻譯自 English
+1

我用老式的方法做到了,搜尋每個最後一個字母 + 一個空格 + USFM 標記。它完成了工作。

機器翻譯自 English
(251 點) 提出
0

你好。

可以構建不同的公式。一個可以回答您的問題並直接在 Paratext 搜尋引擎中使用的公式是:
regex:\p{L}\s\\pn\*
其中:
regex: 是使用正規表示式的命令。
\p{L} 將搜尋任何字母(在本例中是單詞的結尾)。
\s 將搜尋一個空格
\\pn\* 將搜尋 \pn*。必須這樣寫,Regex 才能識別它。
這樣,您將擁有一個列表,列出所有字母後跟空格和 \pn* 的地方。

如果您希望搜尋提取空格前的整個單詞,您只需要在這裡添加一個 + 號: regex:\p{L}+\s\\pn\*

Translated with DeepL Translate: The world's most accurate translator

機器翻譯自 Español
(973 點) 提出

相關問題

0
5 個回答 525 次瀏覽
Recently I noticed that when I attempt to type in the search menu box I get a blank box that says Searching ... I lose the search function. Anyone else encountering this issue?
Chris Guthrie 128 提出 已提問 4月 28, 2020
0
3 個回答 446 次瀏覽
在給出跨章節的經文參考時,Komba 團隊偏好以下標記方式:1:1 - 3:5 也就是說,使用 - 然而,似乎「經文參考設定」(Scripture Reference Settings)無法處理僅在字元後有空格 而在字元前無空格的情況 如果在字 ... 嗎?我猜測其他人也有此偏好慣例 對我們團隊來說,沒有空格的破折號(em-dash)太長,且視覺上不美觀
anon142050 118 提出 已提問 4月 17, 2019
0
1 個回答 489 次瀏覽
I'm finally at the point where I need to ask: is there any way to fix the issue of having to add a space ... selected in Checking > Quotation Rules', but something's not right
Paul 642 提出 已提問 5月 11, 2017
0
6 個回答 755 次瀏覽
您好 是否可能擁有一個共享的空白文件來記錄筆記?我們的團隊需要一個地方來記錄翻譯過程中做出的各種決定。 謝謝。
anon084515 116 提出 已提問 1月 18, 2021
0
2 個回答 50 次瀏覽
在某個專案中,經典的腳註看起來像這樣: \f + \fr cc.v \fq keyword (mostly singular, if noun) \ft Plenty useful stuff.\f* 出於某種原因,我們需要在關鍵字和說明文字之間使用較小的間距 ... 編輯來實現這一點,我願意接受指導 只是希望避免重新發明輪子,因為可能已經有現成的解決方案
Tim 934 提出 已提問 5月 29
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
So Peter was kept in prison, but the church was earnestly praying to God for him.
Acts 12:5
3,048 個問題
6,007 個回答
5,672 則評論
2,027 位使用者