DiffGranularity
是 Diff 及相关函数的一个选项,指定以何种粒度比较给定的表达式.
更多信息
- DiffGranularity 的有效设置取决于将要比较的表达式.
- DiffGranularity 的设置包括:
-
"Lists" 逐项比较列表 "Characters" 逐个字符比较字符串 "Words" 一次一个单词,对字符串进行比较 "Lines" 一次一行,对字符串或文件进行比较 "Cells" Cell 之间互相比较 "Notebooks" Notebook 之间互相比较 - 采用默认设置 Automatic 时,将为给定的表达式选择适当的粒度.
- 默认粒度取决于所比较的表达式的标头:
-
List "Lists" String "Characters" BioSequence "Characters" Cell "Cells" ExpressionCell "Cells" TextCell "Cells" CellObject "Cells" Notebook "Notebooks" NotebookObject "Notebooks" File["file.nb"] "Notebooks" File[other] "Lines"
范例
打开所有单元关闭所有单元基本范例 (1)
用 DiffGranularity 将字符串作为行序列:
属性和关系 (1)
用 DiffGranularity 逐行对笔记本文件的原始文本进行比较:
Wolfram Research (2024),DiffGranularity,Wolfram 语言函数,https://reference.wolfram.com/language/ref/DiffGranularity.html.
文本
Wolfram Research (2024),DiffGranularity,Wolfram 语言函数,https://reference.wolfram.com/language/ref/DiffGranularity.html.
CMS
Wolfram 语言. 2024. "DiffGranularity." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/DiffGranularity.html.
APA
Wolfram 语言. (2024). DiffGranularity. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/DiffGranularity.html 年