This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
from collections import defaultdict | |
import json | |
from pathlib import Path | |
import re | |
from typing import Counter | |
parser = argparse.ArgumentParser(description='Create a JSON file with word pairs using word alignment files') | |
parser.add_argument('-s', '--source', type=Path, help='Source file', required=True) | |
parser.add_argument('-t', '--target', type=Path, help='Target file', required=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
from pathlib import Path | |
import re | |
from typing import List, Tuple | |
def main(): | |
parser = argparse.ArgumentParser(description='Create a JSON file with word pairs using word alignment files') | |
parser.add_argument('-s', '--source', type=Path, help='Source file', required=True) | |
parser.add_argument('-t', '--target', type=Path, help='Target file', required=True) | |
parser.add_argument('-a1', '--input1', type=Path, help='Alignment file 1', required=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Default rendering rules for Maperitive resembling that of OSM Mapnik | |
// http://maperitive.net | |
// Created by Igor Brejc | |
// Released under the Creative Commons Attribution-ShareAlike 3.0 License (http://creativecommons.org/licenses/by-sa/3.0/) | |
// Updates by Michael <quelbs_at_gmail.com> | |
// Icons used: Map icons CC-0 from SJJB Management (http://www.sjjb.co.uk/mapicons) | |
// Modified by Iikka Hauhio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2020 The HuggingFace Team. All rights reserved. | |
# | |
# Copyright 2024 Iikka Hauhio (removed OPUS/Tatoeba-specific code to allow converting arbitrary models) | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import taivutin | |
import stanza | |
import re | |
nlp = stanza.Pipeline("fi") | |
tai = taivutin.Taivutin() | |
case_stanza2taivutin = { | |
"Nom": "nom", | |
"Gen": "gen", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (c) 2023 Iikka Hauhio | |
# Use freely but attribute me | |
import argparse | |
import readline | |
import traceback | |
from pynvml import * | |
import rich, rich.text, rich.panel, rich.live, rich.console | |
import torch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This is a script that can analyze Klingon words using the boQwI' dictionary. | |
* | |
* You need to have dictionary.json available somewhere. | |
* | |
* Usage: | |
* | |
* const analyzeWord = await initializeDictionary(); | |
* console.log(analyzeWord("Heghlu'meH")) | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#*************************************************************************************** | |
# Klingon | |
# Definition des liens entre la notation Sampa et les Fragments | |
C GLST T2 SH | |
G RXS RXS | |
N NG | |
T GLST T2 GLST LFI | |
a A | |
b SQ B |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Klingon keyboard layout for the Sailfish keyboard (Jolla maliit plugin) | |
* | |
* Copyright (C) Iikka Hauhio 2020 | |
* Saa käyttää vapaasti mihin tahansa tarkoitukseen :) | |
* May be used freely for whatever purpose | |
* | |
* How to install: | |
* 1. Copy file to /usr/share/maliit/plugins/com/jolla/layouts/ | |
* 2. Add this text to the end of /usr/share/maliit/plugins/com/jolla/layouts/layouts_western.conf: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
conllu := require("conllu") | |
} | |
main treebank { | |
time := currentTime() | |
conllu.parseSentences treebank | addTree _ | |
time = currentTime()-time | |
print time/1000, " s" |
NewerOlder