{"id":16379073,"url":"https://github.com/derklaro/intera","last_synced_at":"2026-04-18T20:30:20.128Z","repository":{"id":40315217,"uuid":"321158969","full_name":"derklaro/intera","owner":"derklaro","description":"A user-interface library for converting rome numerals to arabic and back written in java.","archived":false,"fork":false,"pushed_at":"2023-12-15T05:11:49.000Z","size":108,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-01T17:42:51.624Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/derklaro.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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":"2020-12-13T20:59:21.000Z","updated_at":"2021-10-05T19:22:17.000Z","dependencies_parsed_at":"2023-12-15T06:27:46.510Z","dependency_job_id":"2e41303a-c6ba-4adf-ad3b-607bf361f0be","html_url":"https://github.com/derklaro/intera","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derklaro%2Fintera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derklaro%2Fintera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derklaro%2Fintera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derklaro%2Fintera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derklaro","download_url":"https://codeload.github.com/derklaro/intera/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240018707,"owners_count":19734874,"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":[],"created_at":"2024-10-11T03:47:24.962Z","updated_at":"2026-04-18T20:30:20.069Z","avatar_url":"https://github.com/derklaro.png","language":"Java","readme":"# intera\n\n![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/derklaro/intera/build/master)\n[![JitPack](https://jitpack.io/v/derklaro/intera.svg)](https://jitpack.io/#derklaro/intera)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue)](license.txt)\n\nA user-interface library for converting rome numerals to arabic and back written in java.\n\n### Example usage\n\nFor basic usage you can just use the default implementation with all common roman counting rules\napplied. To obtain the default instance you can simply use:\n\n```java\nfinal Intera intera = Intera.defaults();\n```\n\nThe default instance is shared, and you don't have to use a local variable to save the instance. All\nintera instances are thread save.\n\nAn instance of intera only has to methods: `parse` and `write`. `parse` simply converts a roman\nnumber as a string to an arabic number using the known associations defined in the instance (We will\ncome to that later). `write` converts the arabic letter back to a roman number string. For example:\n\n```java\nfinal int arabic = Intera.defaults().parse(\"MDCCLXXX\"); // 1780\nfinal String roman = Intera.defaults().write(1780); // MDCCLXXX\n```\n\nThe default number mapping is:\n\n| Rome   | I | V | X  | L  | C   | D   | M    |\n|--------|---|---|----|----|-----|-----|------|\n| Arabic | 1 | 5 | 10 | 50 | 100 | 500 | 1000 |\n\nYou can change this mapping by using the intera-builder:\n\n```java\nfinal Intera intera = Intera.builder()\n  .registerAssociation('X', 100)\n  .registerAssociation('I', 1000)\n  .registerAssociation('M', 10000)\n  .build();\n```\n\nYou can also change the mathematical behaviour of the instance. By default, a maximum of three same\nchars can follow each other:\n`XXX` is ok (30), `XXXX` (40) has to be `XL` (50 - 10)\n\nThis behaviour can be modified in the builder. In this example we set the maximum same chars in a\nrow to 5. If this value is smaller or equal to 1 the check is disabled:\n\n```java\nfinal Intera intera = Intera.builder()\n  .defaultAssociations()\n  .maxSameCharsInRow(5)\n  .build();\n```\n\nThere is still one other rule in the roman math system. Subtractions are only allowed in some cases.\nYou can only subtract by 1 from a 5 or 10, by 10 from a 50 and 100 and by 100 from a 500 and 1000.\nThese rules can get disabled by using the builder as well as modified. To disable you can simply\nuse:\n\n```java\nfinal Intera intera = Intera.builder()\n  .defaultAssociations()\n  .subtractionValidator(SubtractionValidator.disabled())\n  .build();\n```\n\nTo modify the behaviour you can simply use:\n\n```java\nfinal Intera intera = Intera.builder()\n  .defaultAssociations()\n  .subtractionValidator((number, subtraction) -\u003e number \u003e subtraction)\n  .build();\n```\n\nThe result is a boolean which when `true` indicates that the operation can't be done, `false`\notherwise.\n\nThis was a quick go-trough all features of the library, for more information check the\ndocumentation.\n\n### Get intera\n\nThe compiled jar file is always included in\nthe [latest release](https://github.com/derklaro/intera/releases/latest).\n\nFor gradle you may use:\n\n```groovy\nmaven {\n  name 'jitpack'\n  url 'https://jitpack.io'\n}\n\ndependencies {\n  implementation 'com.github.derklaro:intera:1.0.1'\n}\n```\n\nFor maven:\n\n```xml\n\u003crepository\u003e\n  \u003cid\u003ejitpack.io\u003c/id\u003e\n  \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n\u003c/repository\u003e\n\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.derklaro\u003c/groupId\u003e\n  \u003cartifactId\u003eintera\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Contributing\n\nI appreciate contributions of any type. For any new features or fixes/style changes, please open an\nissue\n\nThe project is built with Gradle, require at least JDK 8, and use the google checkstyle\nconfiguration. Please make sure all tests pass, license headers are updated, and checkstyle passes\nto help us review your contribution.\n\n### License\n\n`intera` is released under the terms of the [MIT License](license.txt).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderklaro%2Fintera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderklaro%2Fintera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderklaro%2Fintera/lists"}