使用python,我想「教育」純文本輸入的引號並將它們轉換爲上下文語法。這裏是(遞歸)例如:解析文本以替換引號和嵌套引號
原文:
Using python, I would like "educate" quotes of
a plain text input and turn them into the Context syntax.
Here is a (recursive) example:
輸出:
Using python, I would like \quotation{educate} quotes of
a plain text input and turn them into the Context syntax.
Here is a (recursive) example:
我想它來處理嵌套的報價,以及:
原文:
Original text: "Using python, I would like 'educate' quotes of
a plain text input and turn them into the Context syntax.
Here is a (recursive) example:"
輸出:
Original text: \quotation {Using python, I would like \quotation{educate} quotes of
a plain text input and turn them into the Context syntax.
Here is a (recursive) example:}
當然,我應該照顧的邊緣情況,例如:
She said "It looks like we are back in the '90s"
上下文規格報價是在這裏:
http://wiki.contextgarden.net/Nested_quotations#Nested_quotations_in_MkIV
是什麼對這種情況最敏感的方法?非常感謝你!
謝謝,這是一個非常好的模板。我需要收集一些邊緣案例以用真實情況進行測試,並相應地進行調整。 – Alex 2013-04-28 16:01:12