HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //workspace/parse_lehrplan.py
from bs4 import BeautifulSoup
import re

def extract_content(filename):
    with open(filename, 'r', encoding='utf-8') as f:
        html = f.read()
    
    soup = BeautifulSoup(html, 'html.parser')
    
    # Finde den Hauptcontent-Bereich
    content = soup.find('div', {'id': 'content'})
    if not content:
        return "Kein Content gefunden"
    
    # Extrahiere Text mit Struktur
    text_parts = []
    
    # Finde alle Lernbereiche
    for section in content.find_all(['h4', 'h5', 'p', 'li'], recursive=True):
        if section.name in ['h4', 'h5']:
            text_parts.append(f"\n=== {section.get_text(strip=True)} ===")
        elif section.name == 'p':
            text = section.get_text(strip=True)
            if text and not text.startswith('Die Schülerinnen und Schüler ...'):
                text_parts.append(text)
        elif section.name == 'li':
            text = section.get_text(strip=True)
            # Entferne Prozessbezogene Kompetenzen-Texte
            text = re.sub(r'Prozessbezogene Kompetenzen:.*$', '', text, flags=re.MULTILINE)
            if text:
                text_parts.append(f"- {text}")
    
    return '\n'.join(text_parts)

alt = extract_content('/workspace/lehrplan_alt.html')
neu = extract_content('/workspace/lehrplan_neu.html')

with open('/workspace/lehrplan_alt_text.txt', 'w', encoding='utf-8') as f:
    f.write(alt)
    
with open('/workspace/lehrplan_neu_text.txt', 'w', encoding='utf-8') as f:
    f.write(neu)

print("Extraktion abgeschlossen")
print(f"Alt: {len(alt)} Zeichen")
print(f"Neu: {len(neu)} Zeichen")