(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 11.3' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 16291, 420] NotebookOptionsPosition[ 14018, 359] NotebookOutlinePosition[ 14342, 375] CellTagsIndexPosition[ 14299, 372] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Basic Examples", "Subsection", CellID->285421464], Cell["Check whether two strings are disjoint:", "Text", CellChangeTimes->{{3.7482799902448864`*^9, 3.7482800014080024`*^9}, { 3.7482805403428907`*^9, 3.748280541197976*^9}, {3.748280941837036*^9, 3.7482809524650984`*^9}}, CellID->221583938], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ InterpretationBox[ FrameBox[ TemplateBox[{GraphicsBox[{ RGBColor[0.9882352941176471, 0.4, 0.25098039215686274`], Thickness[ Dynamic[ If[CurrentValue["CellStyleName"] === "Input", 0.2, 0.1]]], CircleBox[{0, 0}]}, ImageSize -> 10, BaselinePosition -> Scaled[0.05], ImagePadding -> 1],TemplateBox[{3}, "Spacer1"],StyleBox[ "\"StringDisjointQ\"", FontColor -> RGBColor[0.2784313725490196, 0.2784313725490196, 0.2784313725490196], ShowAutoStyles -> False, ShowStringCharacters -> False, FontSize -> 0.78 Inherited, FontFamily -> "Roboto", Selectable -> True, FontWeight -> Dynamic[ If[CurrentValue["CellStyleName"] === "Input", "DemiBold", Plain]], StripOnInput -> False]}, "Row", DisplayFunction->(PaneBox[ RowBox[{ TemplateSlotSequence[1, "\[InvisibleSpace]"]}], BaselinePosition -> Center]& ), InterpretationFunction->(RowBox[{"Row", "[", RowBox[{ RowBox[{"{", TemplateSlotSequence[1, ","], "}"}], ",", RowBox[{"BaselinePosition", "\[Rule]", "Center"}]}], "]"}]& )], Selectable -> False, Background->RGBColor[ 0.9686274509803922, 0.9686274509803922, 0.9686274509803922], ContentPadding->False, FrameMargins->{{3, 4}, {0, -2}}, FrameStyle->Directive[ AbsoluteThickness[1], RGBColor[0.8627450980392157, 0.8627450980392157, 0.8627450980392157]], RoundingRadius->3, StripOnInput->False], ResourceFunction["StringDisjointQ"], BoxID -> "StringDisjointQ"], "[", RowBox[{"\"\\"", ",", "\"\\""}], "]"}]], "Input", CellChangeTimes->{{3.748279971652027*^9, 3.748279978151677*^9}, 3.7482804097388315`*^9, 3.748280614729328*^9, 3.748280918290682*^9}, CellLabel->"In[40]:=", CellID->7099978], Cell[BoxData["False"], "Output", CellChangeTimes->{3.7482799785787196`*^9, 3.748280491705027*^9, 3.7482806932791824`*^9, 3.7482809189617486`*^9}, CellLabel->"Out[40]=", CellID->114785970] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ InterpretationBox[ FrameBox[ TemplateBox[{GraphicsBox[{ RGBColor[0.9882352941176471, 0.4, 0.25098039215686274`], Thickness[ Dynamic[ If[CurrentValue["CellStyleName"] === "Input", 0.2, 0.1]]], CircleBox[{0, 0}]}, ImageSize -> 10, BaselinePosition -> Scaled[0.05], ImagePadding -> 1],TemplateBox[{3}, "Spacer1"],StyleBox[ "\"StringDisjointQ\"", FontColor -> RGBColor[0.2784313725490196, 0.2784313725490196, 0.2784313725490196], ShowAutoStyles -> False, ShowStringCharacters -> False, FontSize -> 0.78 Inherited, FontFamily -> "Roboto", Selectable -> True, FontWeight -> Dynamic[ If[CurrentValue["CellStyleName"] === "Input", "DemiBold", Plain]], StripOnInput -> False]}, "Row", DisplayFunction->(PaneBox[ RowBox[{ TemplateSlotSequence[1, "\[InvisibleSpace]"]}], BaselinePosition -> Center]& ), InterpretationFunction->(RowBox[{"Row", "[", RowBox[{ RowBox[{"{", TemplateSlotSequence[1, ","], "}"}], ",", RowBox[{"BaselinePosition", "\[Rule]", "Center"}]}], "]"}]& )], Selectable -> False, Background->RGBColor[ 0.9686274509803922, 0.9686274509803922, 0.9686274509803922], ContentPadding->False, FrameMargins->{{3, 4}, {0, -2}}, FrameStyle->Directive[ AbsoluteThickness[1], RGBColor[0.8627450980392157, 0.8627450980392157, 0.8627450980392157]], RoundingRadius->3, StripOnInput->False], ResourceFunction["StringDisjointQ"], BoxID -> "StringDisjointQ"], "[", RowBox[{"\"\\"", ",", "\"\\""}], "]"}]], "Input", CellChangeTimes->{{3.7482809272935815`*^9, 3.748280928512704*^9}}, CellLabel->"In[41]:=", CellID->3976521], Cell[BoxData["True"], "Output", CellChangeTimes->{3.7482809298798404`*^9}, CellLabel->"Out[41]=", CellID->547414840] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Scope", "Subsection", CellID->267254639], Cell["All characters are supported:", "Text", CellChangeTimes->{{3.7482800111819797`*^9, 3.7482800487747383`*^9}, { 3.748280116507511*^9, 3.748280126228483*^9}}, CellID->141989888], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"{", RowBox[{"str1", ",", "str2"}], "}"}], "=", RowBox[{ RowBox[{"TextCases", "[", RowBox[{ RowBox[{"ResourceData", "[", "\"\\"", "]"}], ",", "\"\\""}], "]"}], "[", RowBox[{"[", RowBox[{"1", ";;", "2"}], "]"}], "]"}]}]], "Input", CellChangeTimes->{{3.748280151052965*^9, 3.7482802246513243`*^9}}, CellLabel->"In[42]:=", CellID->142713326], Cell[BoxData[ RowBox[{"{", RowBox[{"\<\"\:1f0c\[Nu]\[Delta]\[Rho]\[Alpha] \[Mu]\[Omicron]\[Iota] \ \:1f14\[Nu]\[Nu]\[CurlyEpsilon]\[Pi]\[CurlyEpsilon], \[CapitalMu]\[Omicron]\ \:1fe6\[Sigma]\[Alpha], \[Pi]\[Omicron]\[Lambda]\:03cd\[Tau]\[Rho]\[Omicron]\ \[Pi]\[Omicron]\[Nu], \:1f43\[FinalSigma] \[Mu]\:03ac\[Lambda]\[Alpha] \[Pi]\ \[Omicron]\[Lambda]\[Lambda]\:1f70\\n\[Pi]\[Lambda]\:03ac\[Gamma]\[Chi]\ \[Theta]\[Eta], \:1f10\[Pi]\[CurlyEpsilon]\:1f76 \ \[CapitalTau]\[Rho]\[Omicron]\:03af\[Eta]\[FinalSigma] \:1f31\[CurlyEpsilon]\ \[Rho]\:1f78\[Nu] \[Pi]\[Tau]\[Omicron]\[Lambda]\:03af\[CurlyEpsilon]\[Theta]\ \[Rho]\[Omicron]\[Nu] \:1f14\[Pi]\[CurlyEpsilon]\[Rho]\[Sigma]\[CurlyEpsilon]\ \[CenterDot]\\n\[Pi]\[Omicron]\[Lambda]\[Lambda]\:1ff6\[Nu] \[Delta]' \:1f00\ \[Nu]\[Theta]\[Rho]\:03ce\[Pi]\[Omega]\[Nu] \ \:1f34\[Delta]\[CurlyEpsilon]\[Nu] \ \:1f04\[Sigma]\[Tau]\[CurlyEpsilon]\[Alpha] \[Kappa]\[Alpha]\:1f76 \ \[Nu]\:03cc\[Omicron]\[Nu] \:1f14\[Gamma]\[Nu]\[Omega],\\n\[Pi]\[Omicron]\ \[Lambda]\[Lambda]\:1f70 \[Delta]' \:1f45 \[Gamma]' \:1f10\[Nu] \[Pi]\:03cc\ \[Nu]\[Tau]\:1ff3 \[Pi]\:03ac\[Theta]\[CurlyEpsilon]\[Nu] \:1f04\[Lambda]\ \[Gamma]\[CurlyEpsilon]\[Alpha] \:1f43\[Nu] \[Kappa]\[Alpha]\[Tau]\:1f70 \ \[Theta]\[Upsilon]\[Mu]\:03cc\[Nu],\\n\:1f00\[Rho]\[Nu]\:03cd\[Mu]\ \[CurlyEpsilon]\[Nu]\[Omicron]\[FinalSigma] \:1f25\[Nu] \[Tau]\[CurlyEpsilon] \ \[Psi]\[Upsilon]\[Chi]\:1f74\[Nu] \[Kappa]\[Alpha]\:1f76 \[Nu]\:03cc\[Sigma]\ \[Tau]\[Omicron]\[Nu] \:1f11\[Tau]\[Alpha]\:03af\[Rho]\[Omega]\[Nu].\"\>", ",", "\<\"\:1f00\[Lambda]\[Lambda]' \[Omicron]\:1f50\[Delta]' \:1f67\ \[FinalSigma] \:1f11\[Tau]\:03ac\[Rho]\[Omicron]\[Upsilon]\[FinalSigma] \ \:1f10\[Rho]\[Rho]\:03cd\[Sigma]\[Alpha]\[Tau]\[Omicron], \:1f31\:03ad\[Mu]\ \[CurlyEpsilon]\[Nu]\:03cc\[FinalSigma] \ \[Pi]\[CurlyEpsilon]\[Rho]\[CenterDot]\\n\[Alpha]\:1f50\[Tau]\:1ff6\[Nu] \ \[Gamma]\:1f70\[Rho] \[Sigma]\[CurlyPhi]\[CurlyEpsilon]\[Tau]\:03ad\[Rho]\ \:1fc3\[Sigma]\[Iota]\[Nu] \:1f00\[Tau]\[Alpha]\[Sigma]\[Theta]\[Alpha]\ \[Lambda]\:03af\:1fc3\[Sigma]\[Iota]\[Nu] \ \:1f44\[Lambda]\[Omicron]\[Nu]\[Tau]\[Omicron],\\n\[Nu]\:03ae\[Pi]\[Iota]\ \[Omicron]\[Iota], \[Omicron]\:1f33 \[Kappa]\[Alpha]\[Tau]\:1f70 \[Beta]\ \[Omicron]\:1fe6\[FinalSigma] \ \:1f59\[Pi]\[CurlyEpsilon]\[Rho]\:03af\[Omicron]\[Nu]\[Omicron]\[FinalSigma] \ \:1f28\[CurlyEpsilon]\[Lambda]\:03af\[Omicron]\[Iota]\[Omicron]\\n\:1f24\ \[Sigma]\[Theta]\[Iota]\[Omicron]\[Nu]\[CenterDot] \[Alpha]\:1f50\[Tau]\:1f70\ \[Rho] \:1f41 \[Tau]\[Omicron]\:1fd6\[Sigma]\[Iota]\[Nu] \:1f00\[CurlyPhi]\ \[CurlyEpsilon]\:03af\[Lambda]\[CurlyEpsilon]\[Tau]\[Omicron] \[Nu]\:03cc\ \[Sigma]\[Tau]\[Iota]\[Mu]\[Omicron]\[Nu] \:1f26\[Mu]\[Alpha]\[Rho].\"\>"}], "}"}]], "Output", CellChangeTimes->{{3.748280209093769*^9, 3.74828022621148*^9}, 3.7482809771635685`*^9}, CellLabel->"Out[42]=", CellID->531595169] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ InterpretationBox[ FrameBox[ TemplateBox[{GraphicsBox[{ RGBColor[0.9882352941176471, 0.4, 0.25098039215686274`], Thickness[ Dynamic[ If[CurrentValue["CellStyleName"] === "Input", 0.2, 0.1]]], CircleBox[{0, 0}]}, ImageSize -> 10, BaselinePosition -> Scaled[0.05], ImagePadding -> 1],TemplateBox[{3}, "Spacer1"],StyleBox[ "\"StringDisjointQ\"", FontColor -> RGBColor[0.2784313725490196, 0.2784313725490196, 0.2784313725490196], ShowAutoStyles -> False, ShowStringCharacters -> False, FontSize -> 0.78 Inherited, FontFamily -> "Roboto", Selectable -> True, FontWeight -> Dynamic[ If[CurrentValue["CellStyleName"] === "Input", "DemiBold", Plain]], StripOnInput -> False]}, "Row", DisplayFunction->(PaneBox[ RowBox[{ TemplateSlotSequence[1, "\[InvisibleSpace]"]}], BaselinePosition -> Center]& ), InterpretationFunction->(RowBox[{"Row", "[", RowBox[{ RowBox[{"{", TemplateSlotSequence[1, ","], "}"}], ",", RowBox[{"BaselinePosition", "\[Rule]", "Center"}]}], "]"}]& )], Selectable -> False, Background->RGBColor[ 0.9686274509803922, 0.9686274509803922, 0.9686274509803922], ContentPadding->False, FrameMargins->{{3, 4}, {0, -2}}, FrameStyle->Directive[ AbsoluteThickness[1], RGBColor[0.8627450980392157, 0.8627450980392157, 0.8627450980392157]], RoundingRadius->3, StripOnInput->False], ResourceFunction["StringDisjointQ"], BoxID -> "StringDisjointQ"], "[", RowBox[{"str1", ",", " ", "str2"}], "]"}]], "Input", CellChangeTimes->{{3.748279971652027*^9, 3.748279978151677*^9}, { 3.74828005718858*^9, 3.748280097148576*^9}, {3.748280147163576*^9, 3.748280149157776*^9}, {3.7482802281456738`*^9, 3.748280229859845*^9}, 3.7482804129451523`*^9, 3.748280620877943*^9, 3.7482809792697787`*^9}, CellLabel->"In[43]:=", CellID->221128267], Cell[BoxData["False"], "Output", CellChangeTimes->{3.7482799785787196`*^9, 3.748280100083869*^9, 3.748280230378897*^9, 3.748280549968853*^9, 3.748280713839238*^9, 3.748280979863838*^9}, CellLabel->"Out[43]=", CellID->156614736] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Applications", "Subsection", CellID->20767984], Cell["\<\ See if two words are disjoint in two languages that share an alphabet:\ \>", "Text", CellChangeTimes->{{3.748281093622122*^9, 3.748281124047079*^9}}, CellID->685894737], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"AssociationMap", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ InterpretationBox[ FrameBox[ TemplateBox[{GraphicsBox[{ RGBColor[0.9882352941176471, 0.4, 0.25098039215686274`], Thickness[ Dynamic[ If[CurrentValue["CellStyleName"] === "Input", 0.2, 0.1]]], CircleBox[{0, 0}]}, ImageSize -> 10, BaselinePosition -> Scaled[0.05], ImagePadding -> 1],TemplateBox[{3}, "Spacer1"], StyleBox[ "\"StringDisjointQ\"", FontColor -> RGBColor[ 0.2784313725490196, 0.2784313725490196, 0.2784313725490196], ShowAutoStyles -> False, ShowStringCharacters -> False, FontSize -> 0.78 Inherited, FontFamily -> "Roboto", Selectable -> True, FontWeight -> Dynamic[ If[CurrentValue["CellStyleName"] === "Input", "DemiBold", Plain]], StripOnInput -> False]}, "Row", DisplayFunction->(PaneBox[ RowBox[{ TemplateSlotSequence[1, "\[InvisibleSpace]"]}], BaselinePosition -> Center]& ), InterpretationFunction->(RowBox[{"Row", "[", RowBox[{ RowBox[{"{", TemplateSlotSequence[1, ","], "}"}], ",", RowBox[{"BaselinePosition", "\[Rule]", "Center"}]}], "]"}]& )], Selectable -> False, Background->RGBColor[ 0.9686274509803922, 0.9686274509803922, 0.9686274509803922], ContentPadding->False, FrameMargins->{{3, 4}, {0, -2}}, FrameStyle->Directive[ AbsoluteThickness[1], RGBColor[0.8627450980392157, 0.8627450980392157, 0.8627450980392157]], RoundingRadius->3, StripOnInput->False], ResourceFunction["StringDisjointQ"], BoxID -> "StringDisjointQ"], "[", RowBox[{"#", ",", RowBox[{"First", "[", RowBox[{"WordTranslation", "[", RowBox[{"#", ",", "\"\\""}], "]"}], "]"}]}], "]"}], "&"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.7482811269117923`*^9, 3.7482813269987817`*^9}}, CellLabel->"In[58]:=", CellID->178436940], Cell[BoxData[ RowBox[{"\[LeftAssociation]", RowBox[{ RowBox[{"\<\"mother\"\>", "\[Rule]", "False"}], ",", RowBox[{"\<\"infant\"\>", "\[Rule]", "True"}], ",", RowBox[{"\<\"truck\"\>", "\[Rule]", "False"}], ",", RowBox[{"\<\"piano\"\>", "\[Rule]", "False"}], ",", RowBox[{"\<\"happy\"\>", "\[Rule]", "True"}]}], "\[RightAssociation]"}]], "Output", CellChangeTimes->{{3.7482811909003925`*^9, 3.7482813284456367`*^9}}, CellLabel->"Out[58]=", CellID->486958695] }, Open ]] }, Open ]] }, WindowSize->Automatic, WindowMargins->Automatic, Visible->False, FrontEndVersion->"11.3 for Linux x86 (64-bit) (March 6, 2018)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 56, 1, 70, "Subsection",ExpressionUUID->"eb26d71b-cdbe-4129-970c-c9e0f2b6d2de", CellID->285421464], Cell[639, 25, 247, 4, 70, "Text",ExpressionUUID->"eea86e42-9cb6-4efc-acff-18c0cfd200bf", CellID->221583938], Cell[CellGroupData[{ Cell[911, 33, 1876, 44, 70, "Input",ExpressionUUID->"d97ad8dc-ce30-4221-9b1a-7554734ffbca", CellID->7099978], Cell[2790, 79, 193, 4, 70, "Output",ExpressionUUID->"e40cc2b0-ad97-4601-9148-3820a6d86049", CellID->114785970] }, Open ]], Cell[CellGroupData[{ Cell[3020, 88, 1807, 43, 70, "Input",ExpressionUUID->"8782b936-7758-4588-9a90-350a51f1c892", CellID->3976521], Cell[4830, 133, 119, 3, 70, "Output",ExpressionUUID->"10c1ec3e-6738-402b-b36b-465f79d8f2e4", CellID->547414840] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[4998, 142, 47, 1, 70, "Subsection",ExpressionUUID->"4bc90fb1-85d7-476a-9313-a39f73fabc07", CellID->267254639], Cell[5048, 145, 184, 3, 70, "Text",ExpressionUUID->"e3ae48e7-cbaf-4f52-8523-afbd176690f4", CellID->141989888], Cell[CellGroupData[{ Cell[5257, 152, 443, 13, 70, "Input",ExpressionUUID->"a49d476b-fe17-4a71-a359-11b40cdec45f", CellID->142713326], Cell[5703, 167, 2861, 44, 70, "Output",ExpressionUUID->"895d81fb-d0f9-451c-adc0-4d2546a2b0a9", CellID->531595169] }, Open ]], Cell[CellGroupData[{ Cell[8601, 216, 2014, 46, 70, "Input",ExpressionUUID->"4af9244c-46ef-4145-90c1-8f3f7a04c068", CellID->221128267], Cell[10618, 264, 236, 5, 70, "Output",ExpressionUUID->"41e1180b-73f3-4de4-9d03-10955a5644a2", CellID->156614736] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[10903, 275, 53, 1, 70, "Subsection",ExpressionUUID->"5b93a645-9e6a-4b81-9431-9d430a8f8143", CellID->20767984], Cell[10959, 278, 180, 4, 70, "Text",ExpressionUUID->"160a4fac-cfec-4f72-b197-8c662135925e", CellID->685894737], Cell[CellGroupData[{ Cell[11164, 286, 2338, 56, 70, "Input",ExpressionUUID->"039ca88b-f950-46b7-80c9-ad5cb64a84f7", CellID->178436940], Cell[13505, 344, 485, 11, 70, "Output",ExpressionUUID->"c049c741-ca51-4653-8a4b-4f4600156b7c", CellID->486958695] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)