Feed aggregator

10-HarmonyOS5-TextProcessingEntity-Case

Hacker News - 37 min 55 sec ago

This article introduces how to use @kit.NaturalLanguageKit in HarmonyOS to extract email addresses from text. By creating a TextProcessingEntity component, users can input text containing email addresses, click a button to extract the email addresses, and finally display the extracted email addresses.

import { EntityType, textProcessing } from '@kit.NaturalLanguageKit';

@Entry @Component struct TextProcessingEntity { @State article: string = '电子邮件(EMAIL):识别文本中的电子邮件地址,如“example@abc.com”'; @State email: string = ''

build() { Column({ space: 20 }) { TextArea({ text: this.article }) .height(200) Text('电子邮箱:' + this.email) Button('提取邮箱') .onClick(async () => { const results = await textProcessing.getEntity(this.article) results.forEach(item => { if (item.type === EntityType.EMAIL) { this.email = item.text } }) }) } .padding(15) .height('100%') .width('100%') } }

Comments URL: https://news.ycombinator.com/item?id=44296507

Points: 1

# Comments: 0

Categories: Hacker News

09-TextProcessing-WordSegment-Case

Hacker News - 38 min 56 sec ago

This article introduces how to use @kit.NaturalLanguageKit in HarmonyOS for text word segmentation and implement a simple sentiment analysis function. By creating a TextProcessingWordSegment component, users can input evaluation text, click a button to perform sentiment analysis, and finally display the sentiment tendency (positive, negative, or neutral) of the evaluation.

import { textProcessing } from '@kit.NaturalLanguageKit';

@Entry @Component struct TextProcessingWordSegment { @State comment: string = 'The logistics is fast, the packaging is good, and I am particularly satisfied with the product'; @State label: string = ''

build() { Column({ space: 20 }) { TextArea({ text: this.comment }) .height(200) Text('Evaluation Nature: ' + this.label) Button('Sentiment Analysis') .onClick(async () => { const results = await textProcessing.getWordSegment(this.comment) const words = results.map(item => item.word) const service = new SentimentAnalysisService() this.label = service.analyze(words) }) } .padding(15) .height('100%') .width('100%') } }

// Sentiment Analysis Service Class class SentimentAnalysisService { private positiveWords = ['good', 'satisfied', 'great', 'excellent', 'fast']; private negativeWords = ['bad', 'slow', 'expensive', 'awful', 'unsatisfied'];

analyze(words: string[]) { let score = 0.5; words.forEach(word => { if (this.positiveWords.includes(word)) { score += 0.1; } if (this.negativeWords.includes(word)) { score -= 0.1; } }); score = Math.max(0, Math.min(1, score)); const label = score > 0.6 ? 'Positive' : score < 0.4 ? 'Negative' : 'Neutral'; return label; } }

Comments URL: https://news.ycombinator.com/item?id=44296502

Points: 1

# Comments: 0

Categories: Hacker News

Show HN: Open-Source Emoji Economy with Multi-Species Governance for Co-Creation

Hacker News - 39 min 50 sec ago

Hey HN

We just open-sourced MetaKarma Hub, a fully modular, emoji-powered karma economy for co-creation between humans, agents, and future digital species. (just an experiment for now for the community to build on)

It’s designed as a remix-friendly space where:

* Content and reactions mint value * Decisions are made via *multi-species supermajority governance* * Creators, reactors, remixers, and influencers all earn * It’s built from day one to support *AI agent participation, safe and fair coordination

Why this? We believe co-building value systems like this is one of the best long-term safety practices as AI advances, a sandbox where humans and agents can experiment with shared rules, karma, and currencies.

Highlights:

* Every emoji has a value weight and earns karma * Coins can be remixed with automatic revenue splits * Fully auditable logchain (with cryptographic hash chains) * Treasury, influencer rewards, dynamic emoji market * Governance with timelocks, karma-weighted votes, and cross-species balancing

MIT licensed.

Comments URL: https://news.ycombinator.com/item?id=44296497

Points: 1

# Comments: 0

Categories: Hacker News

Show HN: I built a tool to help you sell Digital Downloads via Stripe

Hacker News - 52 min 5 sec ago

Hey HN, I'm Ben, the founder of DownloadPage

Let me share a quick story...

I used to sell a digital product through Lemon Squeezy.

It was full of bugs, the fees were high, and payouts were slow.

When I switched to Stripe, I started saving money and got paid faster.

The only problem? Selling directly meant stitching together a bunch of tools just to deliver a file.

So I built DownloadPage to make it simple. You connect Stripe, upload your product, and share a link. That's it.

If you're tired of giving up a cut to your payment processor, this is for you! Let me know what you think.

P.S. I'll personally do the work of migrating you from your old payment processor to DownloadPage via Stripe! Free white-glove service is included with all plans.

Comments URL: https://news.ycombinator.com/item?id=44296422

Points: 2

# Comments: 0

Categories: Hacker News

Show HN: Paygo.network – no subscription AI tools

Hacker News - 59 min 17 sec ago

Can't be the only one paying all the possible subscriptions for AI models I barely use. I was integrating OpenAI APIs for a project I've done recently, then I thought I would be way better if I used APIs myself instead of the 20$/month subscription - I use Claude more, but for certain things, I prefer ChatGPT - I created my own playgroup chatbox, one thing led to another, launched public beta 1 yesterday. Plan to integrate Stripe for payments today, other APIs by the end of the week, and focus on image and video generators next. It's invite only atm, so use "PAYGBETA" when registering. Appreciate any feedback! Tx.

Comments URL: https://news.ycombinator.com/item?id=44296385

Points: 1

# Comments: 0

Categories: Hacker News

Pages