t_wの輪郭

リンク日記RSS
あれ
あれ
あれ

ラーメン抽象

2025/9/11 2:50:00
0..*

«C»

ラーメン

«I»

トッピング

«C»

麺

«I»

スープ

«I»

量

«I»

太さ

«I»

硬さ

元ネタ ラーメンの抽象化製作 ChatGPT GPT-5
あれ
あれ
あれ
あれ
あれ
あれ
あれ
あれ
あれ
あれ

あれ

2025/9/1 11:39:00

デラングパーサーのためにDOMのようなものを自作してしまっているが「ホントにこれやんの?」という感じがある。素直に先人が作ったPEGなどを用いるライブラリを使って実装したほうがよさそうな気がする。

あれ
あれ

ブログ改修2025年8月31日

2025/9/1 11:33:00
  • 実装途中だったRepositoryを完成させる
  • レンタルサーバーでDuckDBが動かなくなったためAppRunへ移行
  • デライトCSVインポート機能追加
    • インポート機能設計
    • デラングパーサー開発
      • テストデータ作成
      • 構文木クラス作成
      • 構文木比較機能作成
      • HTMLパーサーの用意
      • パーサー部分実装
あれ
あれ

2025年8月31日時点での実装

2025/8/31 11:10:00
class PostImportService {
    constructor(private readonly src_repository: IPostRepository, private readonly dest_repository: IPostRepository) { }

    async import() {
        for (let i = 0; i < 100000; i++) {
            const batch_size = 10;
            const posts = await this.src_repository.list({ take: batch_size, skip: i * batch_size });
            if (posts.length === 0) {
                break;
            }
            for (const post of posts) {
                const post_in_dest = await this.dest_repository.getByKno(post.kno);
                if (post_in_dest.posted_at < post.posted_at) {
                    this.dest_repository.save(post);
                }
            }
        }
    }
}
あれ
あれ
あれ