The Naibbe cipher
#72
Addendum to You are not allowed to view links. Register or Login to view.:

You can also create a heat map in which the labels are displayed in Voynichese. This requires that the font (usually “eva1.ttf”) be installed on your PC. In the following line in the Python script, the path to the font must be adjusted (line 59):

custom_font_path = "/home/me/.local/share/fonts/eva1.ttf"


The call is made as already described, where 25 is the variable number of listed pairs:

python heatmap_prefix_suffix.py parsed.txt 25


Code:
#!/usr/bin/env python3 import sys from collections import Counter import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from matplotlib import font_manager as fm def extract_prefix_suffix(word):     parts = word.split('/')     if len(parts) < 3:         return [], [], None     stem_index = len(parts) // 2     prefix = parts[:stem_index]     suffix = parts[stem_index+1:]     return prefix, suffix, parts[stem_index] def main():     if len(sys.argv) < 2:         print("Usage: python heatmap_prefix_suffix.py output_segmented.txt [N]")         sys.exit(1)     filename = sys.argv[1]     top_n = 20  # default number of top prefixes and suffixes     if len(sys.argv) >= 3:         try:             top_n = int(sys.argv[2])         except ValueError:             print("Parameter N must be an integer.")             sys.exit(1)     prefix_suffix_counts = Counter()     with open(filename, 'r', encoding='utf-8') as f:         for line in f:             words = line.strip().split()             for w in words:                 prefix, suffix, stem = extract_prefix_suffix(w)                 for pre in prefix:                     for suf in suffix:                         prefix_suffix_counts[(pre, suf)] += 1     if not prefix_suffix_counts:         print("No prefix-suffix combinations found.")         sys.exit(1)     data = [{"prefix": pre, "suffix": suf, "count": count}             for (pre, suf), count in prefix_suffix_counts.items()]     df = pd.DataFrame(data)     # Select top N prefixes and suffixes by total count     top_prefixes = df.groupby('prefix')['count'].sum().nlargest(top_n).index     top_suffixes = df.groupby('suffix')['count'].sum().nlargest(top_n).index     pivot = df.pivot(index='prefix', columns='suffix', values='count').fillna(0)     pivot_top = pivot.loc[top_prefixes, top_suffixes]     # Lade lokalen Font     custom_font_path = "/home/me/.local/share/fonts/eva1.ttf"     custom_font = fm.FontProperties(fname=custom_font_path, size=12)     # Plot     plt.figure(figsize=(18, 12))     ax = sns.heatmap(         pivot_top,         annot=True,         fmt=".0f",         cmap="YlGnBu",         cbar_kws={"shrink": 0.5}     )     plt.title(f"Top {top_n} Prefix-Suffix Combinations")     plt.xlabel("Suffix")     plt.ylabel("Prefix")     # Achsenbeschriftungen (Tick-Labels) mit lokalem Font     ax.set_xticklabels(ax.get_xticklabels(), fontproperties=custom_font, rotation=45, ha='right')     ax.set_yticklabels(ax.get_yticklabels(), fontproperties=custom_font, rotation=0)     plt.subplots_adjust(bottom=0.2)     plt.show() if __name__ == "__main__":     main()

   
   

Here are the text files for parsing:

.txt   naibbe.txt (Size: 142 KB / Downloads: 12)

.txt   ZL3a-n_B.txt (Size: 143.11 KB / Downloads: 9)
Reply


Messages In This Thread
The Naibbe cipher - by magnesium - 03-08-2025, 04:18 PM
RE: The Naibbe cipher - by bi3mw - 03-08-2025, 04:46 PM
RE: The Naibbe cipher - by magnesium - 03-08-2025, 06:45 PM
RE: The Naibbe cipher - by oshfdk - 03-08-2025, 10:24 PM
RE: The Naibbe cipher - by magnesium - 04-08-2025, 02:24 AM
RE: The Naibbe cipher - by oshfdk - 04-08-2025, 08:57 AM
RE: The Naibbe cipher - by magnesium - 04-08-2025, 10:37 AM
RE: The Naibbe cipher - by oshfdk - 04-08-2025, 10:56 AM
RE: The Naibbe cipher - by magnesium - 04-08-2025, 11:28 AM
RE: The Naibbe cipher - by pfeaster - 04-08-2025, 01:31 PM
RE: The Naibbe cipher - by oshfdk - 04-08-2025, 01:55 PM
RE: The Naibbe cipher - by Yavernoxia - 04-08-2025, 02:02 PM
RE: The Naibbe cipher - by oshfdk - 04-08-2025, 02:32 PM
RE: The Naibbe cipher - by magnesium - 04-08-2025, 02:30 PM
RE: The Naibbe cipher - by oshfdk - 04-08-2025, 02:57 PM
RE: The Naibbe cipher - by magnesium - 04-08-2025, 03:18 PM
RE: The Naibbe cipher - by bi3mw - 03-08-2025, 10:38 PM
RE: The Naibbe cipher - by oshfdk - 03-08-2025, 10:44 PM
RE: The Naibbe cipher - by MarcoP - 04-08-2025, 10:17 AM
RE: The Naibbe cipher - by magnesium - 04-08-2025, 02:34 AM
RE: The Naibbe cipher - by Yavernoxia - 04-08-2025, 11:03 AM
RE: The Naibbe cipher - by magnesium - 04-08-2025, 11:47 AM
RE: The Naibbe cipher - by Yavernoxia - 04-08-2025, 12:12 PM
RE: The Naibbe cipher - by Mauro - 04-08-2025, 02:21 PM
RE: The Naibbe cipher - by MarcoP - 04-08-2025, 04:28 PM
RE: The Naibbe cipher - by magnesium - 04-08-2025, 06:33 PM
RE: The Naibbe cipher - by oshfdk - 04-08-2025, 06:50 PM
RE: The Naibbe cipher - by magnesium - 04-08-2025, 07:37 PM
RE: The Naibbe cipher - by RobGea - 04-08-2025, 06:18 PM
RE: The Naibbe cipher - by Juan_Sali - 05-08-2025, 12:15 AM
~ - by magnesium - 05-08-2025, 01:33 AM
RE: The Naibbe cipher - by MarcoP - 05-08-2025, 07:35 AM
RE: The Naibbe cipher - by Koen G - 05-08-2025, 08:31 AM
RE: The Naibbe cipher - by magnesium - 05-08-2025, 12:35 PM
RE: The Naibbe cipher - by Rafal - 05-08-2025, 01:19 PM
RE: The Naibbe cipher - by magnesium - 05-08-2025, 02:17 PM
RE: The Naibbe cipher - by magnesium - 05-08-2025, 03:54 PM
RE: The Naibbe cipher - by joben - 06-08-2025, 08:18 AM
RE: The Naibbe cipher - by oaken - 06-08-2025, 12:33 PM
RE: The Naibbe cipher - by MarcoP - 06-08-2025, 03:17 PM
RE: The Naibbe cipher - by quimqu - 13-08-2025, 10:40 PM
RE: The Naibbe cipher - by davidma - 14-08-2025, 12:25 AM
RE: The Naibbe cipher - by quimqu - 14-08-2025, 10:17 AM
RE: The Naibbe cipher - by Rafal - 07-08-2025, 11:04 AM
RE: The Naibbe cipher - by hermesj - 07-08-2025, 09:45 PM
RE: The Naibbe cipher - by magnesium - 08-08-2025, 02:24 AM
RE: The Naibbe cipher - by RobGea - 09-08-2025, 03:16 AM
RE: The Naibbe cipher - by magnesium - 11-08-2025, 02:07 AM
RE: The Naibbe cipher - by Petrasti - 10-08-2025, 06:15 AM
RE: The Naibbe cipher - by Mauro - 10-08-2025, 11:53 AM
RE: The Naibbe cipher - by magnesium - 11-08-2025, 02:22 AM
RE: The Naibbe cipher - by Petrasti - 10-08-2025, 02:37 PM
RE: The Naibbe cipher - by Mauro - 10-08-2025, 03:31 PM
RE: The Naibbe cipher - by Petrasti - 10-08-2025, 03:36 PM
RE: The Naibbe cipher - by Petrasti - 10-08-2025, 04:11 PM
RE: The Naibbe cipher - by Mauro - 10-08-2025, 04:52 PM
RE: The Naibbe cipher - by RobGea - 10-08-2025, 04:56 PM
RE: The Naibbe cipher - by Petrasti - 10-08-2025, 05:42 PM
RE: The Naibbe cipher - by ReneZ - 11-08-2025, 12:30 AM
RE: The Naibbe cipher - by anyasophira - 12-08-2025, 04:57 AM
RE: The Naibbe cipher - by magnesium - 12-08-2025, 10:01 PM
RE: The Naibbe cipher - by bi3mw - 13-08-2025, 05:50 AM
RE: The Naibbe cipher - by magnesium - 13-08-2025, 11:41 AM
RE: The Naibbe cipher - by bi3mw - 13-08-2025, 05:50 PM
RE: The Naibbe cipher - by magnesium - 13-08-2025, 06:04 PM
RE: The Naibbe cipher - by bi3mw - 13-08-2025, 06:31 PM
RE: The Naibbe cipher - by magnesium - 13-08-2025, 06:38 PM
RE: The Naibbe cipher - by RobGea - 13-08-2025, 06:45 PM
RE: The Naibbe cipher - by bi3mw - 13-08-2025, 08:16 PM
RE: The Naibbe cipher - by bi3mw - 13-08-2025, 09:49 PM
RE: The Naibbe cipher - by ReneZ - 14-08-2025, 02:24 AM
RE: The Naibbe cipher - by bi3mw - 14-08-2025, 04:47 PM
RE: The Naibbe cipher - by RobGea - 05-09-2025, 07:52 PM
RE: The Naibbe cipher - by magnesium - 05-09-2025, 07:57 PM
RE: The Naibbe cipher - by nablator - 05-09-2025, 10:08 PM
RE: The Naibbe cipher - by magnesium - 05-09-2025, 10:52 PM
RE: The Naibbe cipher - by magnesium - 06-09-2025, 01:33 AM
RE: The Naibbe cipher - by bi3mw - 05-01-2026, 04:40 PM
RE: The Naibbe cipher - by MarcoP - 06-01-2026, 09:03 AM
RE: The Naibbe cipher - by Koen G - 06-01-2026, 09:47 AM
RE: The Naibbe cipher - by magnesium - 06-01-2026, 10:02 PM
RE: The Naibbe cipher - by Labyrinthinesecurity - 07-01-2026, 05:34 PM
RE: The Naibbe cipher - by magnesium - 07-01-2026, 06:14 PM
RE: The Naibbe cipher - by ahalay-mahalay - 19-01-2026, 10:02 PM
RE: The Naibbe cipher - by tlepkali - 31-08-2026, 08:56 AM
RE: The Naibbe cipher - by DG97EEB - 01-09-2026, 08:50 PM
RE: The Naibbe cipher - by Koen G - 01-09-2026, 09:53 PM
RE: The Naibbe cipher - by JoeyB - 01-09-2026, 10:35 PM
RE: The Naibbe cipher - by nablator - 02-09-2026, 01:35 PM
RE: The Naibbe cipher - by magnesium - 02-09-2026, 12:51 AM
RE: The Naibbe cipher - by Pointless.. - 02-09-2026, 02:10 PM
RE: The Naibbe cipher - by nablator - 02-09-2026, 02:29 PM
RE: The Naibbe cipher - by Pointless.. - 02-09-2026, 03:08 PM
RE: The Naibbe cipher - by Koen G - 02-09-2026, 03:08 PM
RE: The Naibbe cipher - by ololololo - 02-09-2026, 03:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  The Naibbe cipher was amazing, and it made me think of a late night party I went to addekallstrom 0 2,249 28-09-2025, 09:22 AM
Last Post: addekallstrom

Forum Jump:


Users browsing this thread: 1 Guest(s)