{"id":19909664,"url":"https://github.com/chrovis/parattice","last_synced_at":"2025-10-05T15:57:27.358Z","repository":{"id":57652821,"uuid":"274036246","full_name":"chrovis/parattice","owner":"chrovis","description":"Recursive paraphrase lattice generator","archived":false,"fork":false,"pushed_at":"2020-06-22T11:21:29.000Z","size":54,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-06-04T03:18:11.478Z","etag":null,"topics":["cpp","graphviz","java","nlp","paraphrase","paraphrase-generation","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrovis.png","metadata":{"files":{"readme":"README-crate.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}},"created_at":"2020-06-22T04:03:18.000Z","updated_at":"2020-10-22T12:03:43.000Z","dependencies_parsed_at":"2022-08-25T20:11:28.996Z","dependency_job_id":null,"html_url":"https://github.com/chrovis/parattice","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chrovis/parattice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fparattice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fparattice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fparattice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fparattice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrovis","download_url":"https://codeload.github.com/chrovis/parattice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fparattice/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259718013,"owners_count":22901176,"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":["cpp","graphviz","java","nlp","paraphrase","paraphrase-generation","rust"],"created_at":"2024-11-12T21:16:18.437Z","updated_at":"2025-10-05T15:57:22.297Z","avatar_url":"https://github.com/chrovis.png","language":"Rust","readme":"# parattice: Recursive paraphrase lattice generator 🔄\n\nThis library takes a sentence and a paraphrase corpus, recursively finds\nparaphrases based on the corpus, expands the given sentence, and generates a\nparaphrase lattice.\n\nThis library also provides a method to search a phrase in the paraphrase\nlattice.\n\n## Example\n\nThis example generates a paraphrase lattice and searches a phrase in the generated lattice.\n\n```rust\nuse parattice::Lattice;\nuse parattice::LatticeKMP;\nuse parattice::PaRattice;\n\n// initialization\nlet paradict = vec![\n    vec![\n        vec![\"blood\", \"stem\", \"cell\"],\n        vec![\"造血\", \"幹\", \"細胞\"],\n        vec![\"hematopoietic\", \"stem\", \"cell\"],\n    ],\n    vec![\n        vec![\"造血\", \"幹\", \"細胞\", \"移植\"],\n        vec![\"hematopoietic\", \"stem\", \"cell\", \"transplantation\"],\n    ],\n    vec![vec![\"stem\", \"cell\"], vec![\"幹\", \"細胞\"]],\n    vec![\n        vec![\"幹\", \"細胞\", \"移植\"],\n        vec![\"rescue\", \"transplant\"],\n        vec![\"stem\", \"cell\", \"rescue\"],\n    ],\n    vec![vec![\"rescue\"], vec![\"救命\"]],\n    vec![vec![\"blood\"], vec![\"血液\"]],\n];\nlet parattice = PaRattice::new(paradict);\n\n// lattice generation\nlet words = vec![\"造血\", \"幹\", \"細胞\", \"移植\"];\nlet lattice = parattice.get_lattice(\u0026words, true, 2);\n\n// dump a generated lattice\nprintln!(lattice.dump_dot(true));\n\n// serialization \u0026 deserialization\nlet bytes = lattice.to_bytes();\nlet new_lattice = Lattice::new_from_bytes(\u0026bytes);\n\n// search\nlet kmp = LatticeKMP::new(vec![\"幹\", \"細胞\"]);\nlet results = kmp.search(\u0026new_lattice);\nfor result in \u0026results {\n    for edge in result {\n        print!(\"({}, {}) \", edge.0, edge.1);\n    }\n    println!();\n    let s = lattice.get_trunk_span(result.clone());\n    for edge in \u0026s {\n        print!(\"({}, {}) \", edge.0, edge.1);\n    }\n    println!(\"\\n===========\");\n}\n```\n\n## Patents\n\n* [JP2019153267](https://patentscope2.wipo.int/search/en/detail.jsf?docId=JP274788235)\n* [特許第6435467号](https://www.j-platpat.inpit.go.jp/c1800/PU/JP-2019-153267/E7C117D77F8BF276A28A31DC60BF7E4CC5B53B3F230980164BD96541AA9DAA0F/11/ja)\n\n## License\n\nCopyright 2020 [Xcoo, Inc.](https://xcoo.jp/)\n\nLicensed under the [Apache License, Version 2.0](/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrovis%2Fparattice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrovis%2Fparattice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrovis%2Fparattice/lists"}