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 os | |
import re | |
from collections import defaultdict | |
# Define directories | |
base_dir = r'e:\Carte\BB\17 - Site Leadership\alte\Ionel Balauta\Aryeht\Task 1 - Traduce tot site-ul\Doar Google Web\Andreea\Meditatii\2023\Intersection\test' | |
ro_dir = os.path.join(base_dir, 'ro') | |
en_dir = os.path.join(base_dir, 'en') | |
# Function to extract canonical from HTML content |
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 os | |
import re | |
from collections import defaultdict | |
# Define directories | |
base_dir = r'e:\Carte\BB\17 - Site Leadership\Principal 2022' | |
ro_dir = os.path.join(base_dir, 'ro') | |
en_dir = os.path.join(base_dir, 'en') | |
# Function to extract canonical from HTML content |
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 os | |
import re | |
from collections import defaultdict | |
# Define directories | |
base_dir = r'e:\Carte\BB\17 - Site Leadership\Principal 2022' | |
ro_dir = os.path.join(base_dir, 'ro') | |
en_dir = os.path.join(base_dir, 'en') | |
# Function to extract canonical from HTML content |
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
<?php | |
$to_be_replaced = 'wxyz'; // exactly what it wants replaced | |
$nr_start = 1; // from which no start counting | |
$path_files = getcwd(); | |
// echo $path_files; | |
$excluded_files = array( | |
'.htaccess', | |
'robots.txt', | |
'.ftpquota', | |
'dezabonare.html', |
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
<?php | |
$de_inlocuit = 'wxyz'; // exact ce se doreste inlocuit | |
$nr_start = 1; // de la ce nr sa inceapa numaratoarea | |
$cale_fisiere = getcwd(); | |
// echo $cale_fisiere; | |
$fisiere_excluse = array( | |
'.htaccess', | |
'robots.txt', | |
'.ftpquota', | |
'dezabonare.html', |
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 os | |
import re | |
def fix_specific_cross_reference(): | |
"""Repară cross-reference-ul specific pentru exemplul tău""" | |
# Fișierul EN care trebuie reparat | |
en_file = r'e:\Carte\BB\17 - Site Leadership\Principal 2022\en\the-eyes-see-the-world-the-heart-feels-it-deep-down.html' | |
correct_ro_filename = 'ochii-vad-lumea-inima-o-simte-pana-in-adanc.html' | |
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 os | |
import re | |
def test_one_file(): | |
"""Test pe un singur fișier să văd exact ce se întâmplă""" | |
# Testez fișierul pe care l-ai menționat | |
test_file = r'e:\Carte\BB\17 - Site Leadership\Principal 2022\ro\ochii-vad-lumea-inima-o-simte-pana-in-adanc.html' | |
if not os.path.exists(test_file): |
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 os | |
import re | |
from pathlib import Path | |
ro_directory = r'e:\Carte\BB\17 - Site Leadership\Principal\ro' | |
en_directory = r'e:\Carte\BB\17 - Site Leadership\Principal\en' | |
def read_file_with_fallback_encoding(file_path): | |
encodings = ['utf-8', 'latin1', 'cp1252', 'iso-8859-1'] | |
for encoding in encodings: |
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 os | |
import re | |
from pathlib import Path | |
ro_directory = r'e:\Carte\BB\17 - Site Leadership\Principal\ro' | |
en_directory = r'e:\Carte\BB\17 - Site Leadership\Principal\en' | |
def read_file_with_fallback_encoding(file_path): | |
encodings = ['utf-8', 'latin1', 'cp1252', 'iso-8859-1'] | |
for encoding in encodings: |
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 os | |
import re | |
from pathlib import Path | |
ro_directory = r'e:\Carte\BB\17 - Site Leadership\Principal\ro' | |
en_directory = r'e:\Carte\BB\17 - Site Leadership\Principal\en' | |
def read_file_with_fallback_encoding(file_path): | |
encodings = ['utf-8', 'latin1', 'cp1252', 'iso-8859-1'] | |
for encoding in encodings: |
NewerOlder