{"id":24201644,"url":"https://github.com/ramazancetinkaya/morse-code","last_synced_at":"2025-07-03T08:34:51.169Z","repository":{"id":215763939,"uuid":"739720354","full_name":"ramazancetinkaya/morse-code","owner":"ramazancetinkaya","description":"A simple PHP library for converting text to Morse code and vice versa.","archived":false,"fork":false,"pushed_at":"2025-02-22T20:56:57.000Z","size":150,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T11:36:50.937Z","etag":null,"topics":["morse","morse-code","morse-code-converter","morse-code-translator","morsecode","morsecode-encoder-decoder","php","php8"],"latest_commit_sha":null,"homepage":"https://github.com/ramazancetinkaya/morse-code","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ramazancetinkaya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-06T10:41:17.000Z","updated_at":"2025-02-22T20:57:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"8420f90f-d213-4986-9089-c4827fbc4bb6","html_url":"https://github.com/ramazancetinkaya/morse-code","commit_stats":null,"previous_names":["ramazancetinkaya/morse-code"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ramazancetinkaya/morse-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramazancetinkaya%2Fmorse-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramazancetinkaya%2Fmorse-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramazancetinkaya%2Fmorse-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramazancetinkaya%2Fmorse-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramazancetinkaya","download_url":"https://codeload.github.com/ramazancetinkaya/morse-code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramazancetinkaya%2Fmorse-code/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263291045,"owners_count":23443697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["morse","morse-code","morse-code-converter","morse-code-translator","morsecode","morsecode-encoder-decoder","php","php8"],"created_at":"2025-01-13T21:16:36.447Z","updated_at":"2025-07-03T08:34:51.151Z","avatar_url":"https://github.com/ramazancetinkaya.png","language":"PHP","readme":"\u003ch1 align=\"center\"\u003eMorse Code Library\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eA modern PHP library for encoding and decoding Morse code with extended configuration options.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/ramazancetinkaya/morse-code\"\u003e\n    \u003cimg src=\"logo.webp\" alt=\"Logo\" height=\"300\" width=\"300\"\u003e\n  \u003c/a\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/ramazancetinkaya/morse-code/issues\"\u003eReport a Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/ramazancetinkaya/morse-code/pulls\"\u003eNew Pull Request\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n## Features\n\n- Encode and decode Morse code seamlessly.\n- Customizable delimiters for letters and words.\n- Multiple handling options for unknown characters.\n- Configurable case preservation.\n- Structured error handling with custom exceptions.\n- Fully object-oriented and extensible.\n\n## Installation\n\nThis library can be easily installed using [Composer](https://getcomposer.org/), a modern PHP dependency manager.\n\n### Step 1: Install Composer\n\nIf you don't have Composer installed, you can download and install it by following the instructions on the [official Composer website](https://getcomposer.org/download/).\n\n### Step 2: Install the Library\n\nOnce Composer is installed, you can install the `morse-code` library by running the following command in your project's root directory:\n\n```bash\ncomposer require ramazancetinkaya/morse-code\n```\n\n_Alternatively, download the source code and include it in your project manually._\n\n### Requirements\n\n- PHP 8.0 or higher.\n- No additional dependencies.\n\n## Usage\n\n```php\nrequire 'vendor/autoload.php'; // Include Composer's autoloader\n\nuse ramazancetinkaya\\{MorseTranslator, MorseCodeConfig, UnknownCharHandling};\n\n// Create a configuration where unknown characters are replaced with '?'\n// and we separate letters with a single space, words with ' / ', \n// and DO NOT preserve original case (defaults to uppercase).\n$config = new MorseCodeConfig(\n    unknownCharHandling: UnknownCharHandling::REPLACE,\n    replacementChar: '?',\n    preserveCase: false,\n    letterDelimiter: ' ',  // single space between letters\n    wordDelimiter: ' / '   // slash and spaces between words\n);\n\n// Create the translator\n$translator = new MorseTranslator();\n\n// Sample text to encode\n$text = \"Hello, World!\";\n\ntry {\n    // Encoding\n    $encoded = $translator-\u003eencode($text, $config);\n    echo \"Original: {$text}\\n\";\n    echo \"Encoded:  {$encoded}\\n\";\n\n    // Decoding\n    $decoded = $translator-\u003edecode($encoded, $config);\n    echo \"Decoded:  {$decoded}\\n\";\n} catch (MorseCodeException $exception) {\n    // Handle or log the exception\n    echo \"Morse Code Error: \" . $exception-\u003egetMessage() . \"\\n\";\n}\n```\n\n## Configuration Options\n\n| Option               | Description |\n|----------------------|-------------|\n| `unknownCharHandling` | Defines how unknown characters are handled (`IGNORE`, `REPLACE`, `THROW_EXCEPTION`). |\n| `replacementChar`    | Specifies the character used when `REPLACE` mode is enabled. |\n| `preserveCase`       | If `true`, preserves original case; otherwise, converts text to uppercase. |\n| `letterDelimiter`    | Defines the separator between Morse code letters. |\n| `wordDelimiter`      | Defines the separator between Morse code words. |\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.\n\n## Author\n\nDeveloped by [Ramazan Çetinkaya](https://github.com/ramazancetinkaya).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framazancetinkaya%2Fmorse-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framazancetinkaya%2Fmorse-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framazancetinkaya%2Fmorse-code/lists"}