Giter Site home page Giter Site logo

Comments (8)

UnduGT avatar UnduGT commented on August 20, 2024 2

Sorry for the late reply, but yes it works now exactly as it should! Perfect, thank you!

from chat-analytics.

hopperelec avatar hopperelec commented on August 20, 2024 1

There's quite a few issues with that regex (unnecessary grouping, TLD limited to 6 characters, TLD required, misses many characters allowed in path). I feel like it would make more sense to use a regex actually already used by one of the supported platforms, since I'm pretty sure it's anything that the platform highlights blue which we want to exclude. I already found the regex Discord uses ^(https?:\/\/[^\s<]+[^<.,:;"')\]\s]) and it is much more simple and lenient (matching many non-URLs, which I'd much prefer over not matching many URLs). I can't remember why their regex only matches the beginning of a string, but modified for ChatAnalytics it would be https?:\/\/[^\s<]+[^<.,:;"')\]\s]. I'll make a PR now

from chat-analytics.

mlomb avatar mlomb commented on August 20, 2024 1

Hey @UnduGT could you try generating the report again? (using the web app)
Thanks @hopperelec for the Regex!

from chat-analytics.

mlomb avatar mlomb commented on August 20, 2024

Hi! Thanks for the report!
I havent experienced this myself, you mean the small embed Discord includes after sending a link or the link itself?
The links itself should be tokenized as URLs and be completely excluded from the Language tab. Maybe the tokenizer is broken?

{
// match URLs
// TODO: find a better regex, @dperini version (not this one ↓) is probably too restrictive for us
regex: /(?:https?:\/\/)(?:[\da-z\.-]+)\.(?:[a-z\.]{2,6})(?:[\/\w\.\-\?#=@]*)*\/?/gi,
tag: "url",
},

from chat-analytics.

UnduGT avatar UnduGT commented on August 20, 2024

It's the link itself, for example if I search for "MakeModelVariant1" in Discord it shows over 400 results consisting only of links from the same page, no Embeds.
screenshotdiscordbug

from chat-analytics.

mlomb avatar mlomb commented on August 20, 2024

It seems the regex is missing additional URL parameters!

image
(link has been OCRed)

We should find a better regular expression

from chat-analytics.

hopperelec avatar hopperelec commented on August 20, 2024

image
Could just add an ampersand to the character set. Also, not sure what the purpose of that non-capturing group is, or the trailing forward slash considering that's already part of the prior character set

from chat-analytics.

mlomb avatar mlomb commented on August 20, 2024

Lets go for it, do you want to open a PR?
I did not write that regex, I shamelessly stole it from the internet 😅. It has to be revised at some point

from chat-analytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.