我最近碰到了Standard Generalized Markup Language。我从EMILLE/CIIL Corpus获得了SGML格式的语料库。以下是该语料库的文档:
我只想提取文件中的文本。文档中语料库的编码和标记信息为:
The text is encoded as two-byte Unicode text. For more information on Unicode. The texts are marked up in SGML using level 1 CES-compliant markup. Each file also includes a full header, which specifies the provenance of the text.
我很难脱掉这些标签。我试过用“正则表达式”和“靓汤”但都不管用。这是示例文本文件。我想保留的语言是旁遮普语。在
尝试以下操作:
或者 您可以使用简单的正则表达式;如果data是包含以<;开头、以gt;结尾的标记的字符串,则这些标记之间的所有内容都将被丢弃—您可以将多个空白限制为一个,并删除数据。在
相关问题 更多 >
编程相关推荐