ATOMIC AI TEXT AND STRING MANIPULATION SPEC RULE: This document defines the complete and binding set of text and string manipulation functions in the Atomic language. RULE: Only the functions listed in this document exist. RULE: No additional text or string manipulation functions exist. RULE: All rules defined here are mandatory. GENERAL RULES RULE: All text manipulation operations are performed through functions. RULE: All functions listed in this document return a value. RULE: Returned values must be stored in a variable. RULE: Text manipulation functions cannot be used inside arguments of other functions. RULE: Function arguments may be text values, variables, or expressions. RULE: Text values are represented as strings. CHARACTER ACCESS nome_variabile = ottieni il simbolo di un testo a una determinata posizione --> (TESTO:) (POSIZIONE:) RULE: This function returns a single symbol from the specified text. RULE: POSIZIONE is a numeric value. RULE: All positions, rows, and columns in Atomic are 1-based (never 0-based). TEXT REPLACEMENT nome_variabile = ottieni testo con parola sostituita --> (TESTO:) (PAROLA:) (NUOVA PAROLA:) RULE: This function replaces all occurrences of PAROLA. RULE: The function returns the modified text. nome_variabile = ottieni testo con parola sostituita solo la prima volta --> (TESTO:) (PAROLA:) (NUOVA PAROLA:) RULE: This function replaces only the first occurrence of PAROLA. RULE: The function returns the modified text. CASE TRANSFORMATION nome_variabile = ottieni testo minuscolo --> (TESTO:) RULE: This function returns the lowercase version of the text. nome_variabile = ottieni testo maiuscolo --> (TESTO:) RULE: This function returns the uppercase version of the text. TEXT TO NUMBER nome_variabile = ottieni numero da testo --> (TESTO:) RULE: This function converts a text value into a numeric value. FILE TEXT ACCESS nome_variabile = ottieni testo da questo file --> (NOME:) RULE: NOME specifies the file path. RULE: The function returns the entire content of the file as text. nome_variabile = ottieni una riga di testo da questo file --> (NOME:) (RIGA:) RULE: RIGA specifies the line number to retrieve. RULE: The function returns the text of the specified line. TEXT EXPRESSION EVALUATION nome_variabile = ottieni risultato espressione da testo --> (TESTO:) RULE: This function evaluates an expression contained in text. RULE: The result of the expression is returned. TEXT ANALYSIS nome_variabile = ottieni il numero di parole specificate in un testo --> (TESTO:) (PAROLA:) RULE: This function counts the occurrences of PAROLA in the text. RULE: The function returns a numeric value. nome_variabile = ottieni lunghezza testo --> (TESTO:) RULE: This function returns the length of the text. TEXT INSERTION nome_variabile = ottieni testo con inserito altro testo a una determinata posizione --> (TESTO:) (TESTO INSERITO:) (POSIZIONE:) RULE: This function inserts TESTO INSERITO into TESTO at the specified position. RULE: The function returns the modified text. TEXT EXTRACTION nome_variabile = ottieni un pezzo di questo testo --> (TESTO:) (POSIZIONE:) (LUNGHEZZA:) RULE: This function extracts a substring from the text. RULE: POSIZIONE defines the starting position. RULE: LUNGHEZZA defines the number of symbols to extract. STRING FUNCTIONS nome_variabile = ottieni il simbolo di un testo a una determinata posizione --> (TESTO: " ") (POSIZIONE:) nome_variabile = ottieni testo con parola sostituita --> (TESTO: " ") (PAROLA:) (NUOVA PAROLA:) nome_variabile = ottieni testo con parola sostituita solo la prima volta --> (TESTO: " ") (PAROLA:) (NUOVA PAROLA:) nome_variabile = ottieni testo minuscolo --> (TESTO: " ") nome_variabile = ottieni testo maiuscolo --> (TESTO: " ") nome_variabile = ottieni numero da testo --> (TESTO: " ") nome_variabile = ottieni il numero di parole specificate in un testo --> (TESTO: " ") (PAROLA: " ") nome_variabile = ottieni lunghezza testo --> (TESTO:) nome_variabile = ottieni testo con parola sostituita --> (TESTO: " ") (PAROLA: " ") (NUOVA PAROLA: " ") nome_variabile = ottieni testo con parola sostituita solo la prima volta --> (TESTO: " ") (PAROLA: " ") (NUOVA PAROLA: " ") nome_variabile = ottieni testo con inserito altro testo a una determinata posizione --> (TESTO: " ") (TESTO INSERITO: " ") (POSIZIONE:) nome_variabile = ottieni un pezzo di questo testo --> (TESTO: " ") (POSIZIONE:) (LUNGHEZZA:) nome_variabile = ottieni risultato espressione da testo --> (TESTO: " ") nome_variabile = ottieni posizione parola --> (TESTO: " ") (PAROLA: " ") TEXT FILES FUNCTIONS scrivi su questo file --> (NOME: "path and file name") (TESTO: " ") scrivi una nuova linea su questo file --> (NOME: "path and file name") (TESTO: " ") sovrascrivi su questo file --> (NOME: "path and file name") (TESTO: " ") nome_variabile = ottieni testo da questo file --> (NOME: " ") nome_variabile = ottieni una riga di testo da questo file --> (NOME: " ") (RIGA:) FORMAL CLOSURE RULE: The text and string manipulation system of Atomic is limited to the functions listed in this document. RULE: Any text or string manipulation function not listed here: does not exist must not be inferred must not be generated