Is there a way to ignore all English words? So I don't have to go through all and delete?

Like the title says, I just don’t wanna go through each individual words and delete them, even when its not even the target language.

2 Likes

Sorry but no, you can’t ignore them automatically at the moment.

1 Like

That would be indeed a very useful feature. There are many Youtubers (for Chinese) that include English and pinyin along with the hanzi and that creates a mess for us.

Sometimes I download those subtitles to a Word file and run a simple macro to remove the English and then import to LingQ, but it is just time-consuming and I think it should be easy on LingQ side to implement that…

1 Like

To Auto Ignore all Western Names in your lesson you can paste this code into your browser console.

Auto Ignore Western Words Script
//Ignore all western words in the lesson
let language = 'fi';
let lessonId = '22222222';
let url = `https://www.lingq.com/api/v3/${language}/lessons/${lessonId}/words/?cardsTranslitFormat=list`;

ignoreWesternWords();

async function ignoreWesternWords() {

    const response = await fetch(url);
    const data = await response.json();
                
    const newWords = Object.values(data.words).filter(word => word.status === "new");
                
    for (const word of newWords) {
        if (isWestern(word.text)) {
           console.log(`ignoring ${word.text}......`);
           await ignoreWord(word);
        }
    }     
}

async function ignoreWord(word) {
    const wordToIgnore = encodeURIComponent(word.text);
    const apiURL = `https://www.lingq.com/api/languages/${language}/ignored-words/`;

    try {
        const response = await fetch(apiURL, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded',
            },
            body: `word=${wordToIgnore}`
        });

        const data = await response.json();
        console.log(data);

    } catch (error) {
        console.error("Error:", error);
    }
}

function isWestern(text) {
    return /^[\u0020-\u007F\u00A0-\u00FF\u0100-\u024F\s]+$/.test(text);
}

This is also included in MasterLingQ Premium

6 Likes

Thank you very much! You are a monster! :raised_hands: :pray:

Now I’m going to pretend I understood and will ask Chatgpt how to put that into the console :sweat_smile:

Will that produce just a temporary change for that session or definitive? Hopefully it won’t delete the other alphabetic languages.

Or I’d better buy your extension and don’t abuse your good will :grin:

2 Likes

Thanks Atlan,

It will ignore any word that is not an Asian character. (basically entire European alphabet) That will only apply for the language you currently have open but will affect future lessons too.

No pressure to buy anything, just letting you know about it. Enjoy

2 Likes

Thanks again Roosterburton,

Just in case there is somebody else who is not IT-savvy like me, after having a mini-lesson with ChatGPT, for you guys there trying it with Chinese, make sure to replace ‘fi’ with ‘zh’ the code for Chinese (Zhongwen). Also, this works just a single time for each lesson, so we have to replace the lesson ID where it says 22222222. You can see the lesson ID by checking the last numbers at the right of the address when you open it.

Rooster, please correct me if I said something wrong, but that’s what Chat told me since the snippet wasn’t working. I thought that it would already change everything automatically, but Chat said we would need to create an array of lesson IDs to do that. Unless there is a difference that I don’t know for each browser… I’m using Firefox.

1 Like

ChatGPT is right here, to ignore the words in every lesson you could setup permanent script with tampermonkey or via extension that runs every time you open a lesson. Given the starting point of the code i’m sure chatGPT could turn it into a Tampermonkey script easily.

To automate the lesson ID and language you would want to check the url

 if (window.location.href.match(/https:\/\/www\.lingq\.com\/[a-z]{2,3}(-[a-z]{1,2})?\/learn\/[a-z]{2,3}(-[a-z]{1,2})?\/web\/reader\/\d+/)) {
        let urlParts = window.location.pathname.split('/');
        language = urlParts[3]; // Get the language code (e.g., 'fi')
        lessonId = urlParts[6]; // Get the lesson ID (e.g., '23017594')
}

Another option is to just change the lessonId to an array of lessonIds populated from the course and change it to something like

lessonIds.forEach((lessonId) => {
 await ignoreWesternWords(lessonId); 
}

A list of every lesson in your course with its ID can be found here. just change ${language} to fi or zh or whatever and the CourseId to your CourseId

https://www.lingq.com/api/v3/${language}/collections/${courseId}/lessons/?page=1&page_size=1000&sortBy=pos

2 Likes

I live in Japan. In the old times an apprentice could say 弟子にしてください!(please make me your disciple! :grinning: or please be my Master, haha.)

Thank you so much Rooster!

I don’t know if you have posted your contact somewhere else (website/email) but could you please share your contact here? I’d like to ask about some other possible app orders besides your amazing LingQ extensions.

1 Like

That’s great, thanks for sharing. I was in Tokyo 10 years ago, apart from the earthquakes, the other main things I noticed were respect and professionalism. From basically everyone. Do you ever get used to the earthquakes?

You can find all my relevant details here
https://www.theartofdrowning.com/

2 Likes

Thanks a lot Rooster, will email later.

22 years here and I’m not sure if one could ever say “I’m used to earthquakes”. The wall in my house cracked with the big one in 2011 and those big ones can always be our last “thrill”. But isn’t life always like that? A guy afraid to leave his house on Friday 13th got stung by a bee and died in his house…

Comfort or peril, everything passes.

1 Like