### Example Transformations by Language Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Provides examples of text transformations performed by the `replaceOgonki` function for Polish, French, German, and Spanish, demonstrating the removal of various diacritical marks. ```text // Example transformations: // Polish: "zażółć gęślą jaźń" → "zazolc gesla jazn" // French: "café résumé naïve" → "cafe resume naive" // German: "größe über müssen" → "grosse uber mussen" // Spanish: "español mañana año" → "espanol manana ano" ``` -------------------------------- ### Example Transformation Output Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Demonstrates the output format of Ogonki, showing how diacritics are removed and a `_modified` suffix is added to the filename. Example: 'Łukasz Wójcik' becomes 'Lukasz Wojcik'. ```text # Output: Creates document_modified.txt with diacritics removed # Example: "Łukasz Wójcik" becomes "Lukasz Wojcik" ``` -------------------------------- ### Process Czech Text Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Example of using Ogonki with the '-lang cz' flag to process a Czech file. Shows the input string and the resulting output with diacritics removed. ```bash # Example: Process Czech text ./ogonki -lang cz czech_file.txt # Input: "Příliš žluťoučký kůň" # Output: "Prilis zlutoucky kun" ``` -------------------------------- ### Internal Usage Example of replaceOgonki Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Illustrates the internal logic of the `replaceOgonki` function, showing how diacritics for a specific language (Polish) are mapped to their ASCII equivalents. This function uses a `getReplacement` mapping. ```go // Internal usage example: // For Polish (pl), the diacritics map contains: "ąćęłńóśźżĄĆĘŁŃÓŚŹŻ" // Each character is replaced using getReplacement: // ą → a, ć → c, ę → e, ł → l, ń → n, ó → o, ś → s, ź → z, ż → z ``` -------------------------------- ### Process Vietnamese Text Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Example of using Ogonki with the '-lang vi' flag to process a Vietnamese file. Shows the input string and the resulting output with diacritics removed. ```bash # Example: Process Vietnamese text ./ogonki -lang vi vietnamese_file.txt # Input: "Xin chào Việt Nam" # Output: "Xin chao Viet Nam" ``` -------------------------------- ### Process File with Specified Language Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Process a text file using Ogonki, specifying the language for diacritic removal with the -lang flag. For example, use '-lang fr' for French. ```bash # Process a file with French diacritics ./ogonki -lang fr french_document.txt ``` -------------------------------- ### Display Help Information Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Use the -help flag to display usage information for the Ogonki command-line utility. ```bash ./ogonki -help ``` -------------------------------- ### Supported File Extensions and CLI Usage Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Lists supported file categories and demonstrates CLI usage for processing files and handling unsupported formats. ```bash # Supported extension categories: # Programming languages: # .c, .h, .cpp, .cxx, .cs, .java, .js, .ts, .tsx, .py, .pyw, .rb, .rbw # .go, .rs, .rust, .swift, .kt, .php, .php3, .php4, .php5, .pl, .pm # .lua, .r, .m, .matlab, .f, .f90, .f95, .hs, .lhs, .ml, .mli, .nim # .d, .v, .vhdl, .vhd, .asm, .s, .lisp, .lsp, .scm, .ss, .cl, .el # Web technologies: # .html, .htm, .xhtml, .xml, .xsd, .xsl, .xslt, .json5, .jsonc # .css, .svg, .jsp, .asp, .aspx, .php, .phtml # Shell and scripts: # .sh, .bash, .bash_profile, .bashrc, .csh, .bat, .cmd, .ps1, .psm1 # Configuration: # .yaml, .yml, .ini, .cfg, .properties, .conf, .config # Documentation and text: # .txt, .md, .log, .nfo, .info, .srt # Example: Processing different file types ./ogonki -lang pl document.txt script.py config.yaml notes.md # Unsupported format example (will show warning): ./ogonki -lang pl image.png # Output: "Unsupported file format: .png" ``` -------------------------------- ### Building and Running Ogonki Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Workflow for cloning, compiling, and executing the program on different operating systems. ```bash # Clone the repository git clone https://github.com/lukaszwojcikdev/ogonki.git # Navigate to project directory cd ogonki # Compile the program go build ogonki.go # Run on Linux/macOS ./ogonki -lang pl myfile.txt # Run on Windows ogonki.exe -lang pl myfile.txt # Verify installation with help ./ogonki -help # Process a batch of files ./ogonki -lang fr *.txt # Output files are created with _modified suffix: # myfile.txt → myfile_modified.txt # document.md → document_modified.md ``` -------------------------------- ### CLI Usage and File Processing Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Instructions for compiling, running, and processing files using the Ogonki CLI. ```APIDOC ## CLI Execution ### Description Compile and execute the program to normalize text files. The tool preserves original files and creates modified copies with a '_modified' suffix. ### Usage ./ogonki -lang [language_code] [file_path] ### Parameters - **-lang** (string) - Required - The language code for normalization (e.g., pl, fr). - **file_path** (string) - Required - The path to the file or wildcard pattern to process. ### Example ./ogonki -lang pl myfile.txt ### Output Creates 'myfile_modified.txt' with normalized characters. ``` -------------------------------- ### Process Multiple Files with Specified Language Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Process multiple text files simultaneously by listing them after the language flag. Ogonki will process each file individually. ```bash # Process multiple files with Spanish diacritics ./ogonki -lang es file1.txt file2.txt file3.txt ``` -------------------------------- ### Process Single File with Default Language Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Process a single text file using Ogonki with the default Polish language settings. The output file will have a `_modified` suffix. ```bash # Process a single file with default Polish language ./ogonki document.txt ``` -------------------------------- ### Process German Text File Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Use Ogonki to process a German text file by specifying the language code 'gsw' with the -lang flag. ```bash # Process a German file ./ogonki -lang gsw german_text.txt ``` -------------------------------- ### getReplacement Function Signature Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Defines the interface for mapping individual diacritical characters to their ASCII base equivalents. ```go // Function signature func getReplacement(letter string) string // Character mapping examples: // Single character replacements: // ą → a, á → a, à → a, â → a, ä → a, å → a, ă → a, ā → a // ć → c, ç → c, č → c, ĉ → c // é → e, è → e, ê → e, ë → e, ę → e, ě → e // ł → l, ľ → l, ĺ → l // ñ → n, ń → n, ň → n // ö → o, ó → o, ô → o, ő → o, ø → o // ß → B (German sharp s) // ü → u, ú → u, ů → u, ű → u // Multi-character replacements (digraphs): // æ → ae, Æ → AE // œ → oe, Œ → OE // þ → th, Þ → TH // ð → d ``` -------------------------------- ### getReplacement Function Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt Maps individual diacritical characters to their ASCII base equivalents, including multi-character digraph replacements. ```APIDOC ## getReplacement(letter) ### Description Maps individual diacritical characters to their ASCII base equivalents. Handles hundreds of character mappings across all supported languages including special multi-character replacements for digraphs. ### Parameters - **letter** (string) - Required - The character to be normalized. ### Response - **result** (string) - The ASCII base equivalent of the input character. ``` -------------------------------- ### Go Function Signature for replaceOgonki Source: https://context7.com/lukaszwojcikdev/ogonki/llms.txt The core Go function signature for replacing diacritical marks in a given text string based on a specified language. ```go // Function signature func replaceOgonki(text string, lang string) string ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.