AndydeCleyre / colorcodebot

A simple Telegram bot for syntax highlighting
Do What The F*ck You Want To Public License
45 stars 6 forks source link

Guess language #6

Closed AndydeCleyre closed 3 years ago

AndydeCleyre commented 5 years ago
AndydeCleyre commented 5 years ago

I don't know if guesslang will get updated, but I hope so. I don't know what alternative library to use for guessing the programming language.

AndydeCleyre commented 4 years ago
Tool Release Language Functions Correctly identifies sample
guesslang 0.9.4 Python :x: :question:
github-linguist 7.8.0 Ruby :heavy_check_mark: :x:
guesslang 2.0.3 Python :heavy_check_mark: :heavy_check_mark:
github-linguist 7.15.0 Ruby :heavy_check_mark: :x:

Sample (from learnxinyminutes):


# Another class definition
# bat.py
class Bat:

    species = 'Baty'

    def __init__(self, can_fly=True):
        self.fly = can_fly

    # This class also has a say method
    def say(self, msg):
        msg = '... ... ...'
        return msg

    # And its own method as well
    def sonar(self):
        return '))) ... ((('

if __name__ == '__main__':
    b = Bat()
    print(b.say('hello'))
    print(b.fly)
AndydeCleyre commented 3 years ago

I've got this working in a feature branch, but I'm having trouble getting tensorflow installed in the Alpine Linux environment.

Related:

AndydeCleyre commented 3 years ago

Ditching alpine for now to get this done.