Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tanloong/interlaced.nvim
Neovim plugin for aligning bilingual parallel texts
https://github.com/tanloong/interlaced.nvim
corpus-linguistics nvim-plugin parallel-corpus sentence-alignment
Last synced: 7 days ago
JSON representation
Neovim plugin for aligning bilingual parallel texts
- Host: GitHub
- URL: https://github.com/tanloong/interlaced.nvim
- Owner: tanloong
- License: gpl-3.0
- Created: 2023-08-09T20:22:27.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-18T08:20:23.000Z (6 months ago)
- Last Synced: 2024-08-02T06:19:28.902Z (3 months ago)
- Topics: corpus-linguistics, nvim-plugin, parallel-corpus, sentence-alignment
- Language: Lua
- Homepage:
- Size: 43 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim - tanloong/interlaced.nvim - Help align bilingual parallel texts. (Language / PHP)
README
# interlaced.nvim
Join/split current line to align bilingual sentence pairs.
## Features
1. Join current line up to previous pair
2. Split current line down to the next pair
## Requirements
+ Neovim >= **0.9.0**
## Installation
+ Using [lazy.nvim](https://github.com/folke/lazy.nvim)
```lua
{
'tanloong/interlaced.nvim',
config = function()
require("interlaced").setup()
-- or setup with your own config (see Configuration in README)
-- require("interlaced").setup(config)
end,
ft = "text",
},
```
## ConfigurationBellow is a linked snippet with the default values.
https://github.com/tanloong/interlaced.nvim/blob/a29139456f39e1fa52a44c7fb6a05b447dee2c4c/lua/interlaced/config.lua#L1-L19
## Commands
- `SplitEnglishSentences` and `SplitChineseSentences`: These commands are used for sentence segmentation in a **monolingual** buffer. It is important to note that they may not handle all cases perfectly, as they use simple regex patterns to identify sentence boundaries. For more accurate splitting, it is recommended to use an NLP tool. However, if you just want a quick and not-that-accurate splitting, these commands can be helpful.
- `MapInterlaced` and `UnmapInterlaced`: `MapInterlaced` sets keybindings for text manipulations; `UnmapInterlaced` restores them to their previous mappings, if any.
- `InterlaceWithL1` and `InterlaceWithL2`: Take lines from the current buffer and interlaces them with lines from a specified file, forming an array of `(l1, l2)` pairs. These commands also filter out any empty lines from both the buffer and the file to ensure that only non-empty lines are interlaced. The resulting interlaced text is then saved to a new file and opened for further editing. After openning the interlaced file, keybindings are setup if they have not been previously.