From 4b3b5e5723fe4a22d546dd20f2410f2e1d67f9ef Mon Sep 17 00:00:00 2001 From: Michael Leuschel <leuschel@uni-duesseldorf.de> Date: Sun, 3 May 2020 17:56:19 +0200 Subject: [PATCH] add external function descriptions --- manual/ExternalFunctions.ipynb | 253 +++++++++++++++++++++++++++++++++ 1 file changed, 253 insertions(+) diff --git a/manual/ExternalFunctions.ipynb b/manual/ExternalFunctions.ipynb index 9f6bae2..3f8e965 100644 --- a/manual/ExternalFunctions.ipynb +++ b/manual/ExternalFunctions.ipynb @@ -684,6 +684,132 @@ "STRING_TO_LOWER(\"az-AZ-09-äàöù-ÄÖ\")" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### STRING_EQUAL_CASE_INSENSITIVE\n", + "\n", + "This external predicate compares two strings ignoring lower/upper case distinctions and diacritical marks. It works as if converting the strings using ```STRING_TO_UPPER``` before comparing.\n", + "\n", + "Type: $STRING \\times STRING $." + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], + "text/plain": [ + "TRUE" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "STRING_EQUAL_CASE_INSENSITIVE(\"aOuB\",\"AoUB\")" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], + "text/plain": [ + "TRUE" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "STRING_EQUAL_CASE_INSENSITIVE(\"aOu\",\"äöù\")" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], + "text/plain": [ + "TRUE" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "STRING_EQUAL_CASE_INSENSITIVE(\"s-1\",\"ß-1\")" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], + "text/plain": [ + "FALSE" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "STRING_EQUAL_CASE_INSENSITIVE(\"a\",\"\")" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], + "text/plain": [ + "FALSE" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "STRING_EQUAL_CASE_INSENSITIVE(\"abc\",\"abcd\")" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -2115,6 +2241,133 @@ "STRING_IS_NUMBER(\"1e5\")" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### STRING_PADLEFT\n", + "\n", + "This external function adds a padding character at the left of a string if the size of the string is below the argument given.\n", + "\n", + "Type: $STRING \\times INTEGER \\times STRING \\rightarrow STRING $.\n", + "The last argument must be a string of length 1." + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\text{\"00010\"}$" + ], + "text/plain": [ + "\"00010\"" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "STRING_PADLEFT(\"10\",5,\"0\")" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\text{\"--10\"}$" + ], + "text/plain": [ + "\"--10\"" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "STRING_PADLEFT(\"10\",4,\"-\")" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\text{\"100\"}$" + ], + "text/plain": [ + "\"100\"" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "STRING_PADLEFT(\"100\",3,\"2\")" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\text{\"100\"}$" + ], + "text/plain": [ + "\"100\"" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "STRING_PADLEFT(\"100\",0,\"2\")" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\text{\"-------abc\"}$" + ], + "text/plain": [ + "\"-------abc\"" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "STRING_PADLEFT(\"abc\",10,\"-\")" + ] + }, { "cell_type": "markdown", "metadata": {}, -- GitLab