Add ignoring non-period points/dots
This commit is contained in:
@ -87,6 +87,48 @@ defmodule Outlook.InternalTreeTest do
|
||||
%TranslationUnit{status: :untranslated, uuid: @default_uuid,
|
||||
content: "<a href=\"dingsda.com\"><b>A</b> sentence</a> with many letters and many, many words. "}],
|
||||
eph: %{sibling_with: :block}}]
|
||||
|
||||
test "partition_text/1 doesn't split numbers and abbreviated names" do
|
||||
tree = [
|
||||
%InternalNode{
|
||||
name: "p",
|
||||
attributes: %{},
|
||||
type: :element,
|
||||
uuid: "0248aec7-c525-483d-a472-40a34488478d",
|
||||
content: [
|
||||
%InternalNode{
|
||||
name: "",
|
||||
attributes: %{},
|
||||
type: :text,
|
||||
uuid: "d35ac56f-bf10-47b1-af19-152e6225bb32",
|
||||
content: "F. William Engdahl is 3.7 times more likely to write a good article than Mike Adams. But this doesn't mean anything bad about Mike.",
|
||||
eph: %{sibling_with: :inline}
|
||||
}
|
||||
],
|
||||
eph: %{sibling_with: :block}
|
||||
}
|
||||
]
|
||||
assert InternalTree.partition_text(tree) |> unify_uuids_in_tunits() == [
|
||||
%InternalNode{
|
||||
name: "p",
|
||||
attributes: %{},
|
||||
type: :element,
|
||||
uuid: "0248aec7-c525-483d-a472-40a34488478d",
|
||||
content: [
|
||||
%TranslationUnit{
|
||||
status: :untranslated,
|
||||
uuid: @default_uuid,
|
||||
content: "F. William Engdahl is 3.7 times more likely to write a good article than Mike Adams. "
|
||||
},
|
||||
%TranslationUnit{
|
||||
status: :untranslated,
|
||||
uuid: @default_uuid,
|
||||
content: "But this doesn't mean anything bad about Mike."
|
||||
}
|
||||
],
|
||||
eph: %{sibling_with: :block}
|
||||
}
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user